{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<!DOCTYPE html>\n",
      "<html>\n",
      " <head>\n",
      "  <meta charset=\"utf-8\"/>\n",
      "  <title>\n",
      "   second\n",
      "  </title>\n",
      "  <style>\n",
      "   *{\n",
      "text-align: center;\n",
      "color: red;\n",
      "}\n",
      "  </style>\n",
      " </head>\n",
      " <body>\n",
      "  <h2>\n",
      "   美丽的汤\n",
      "  </h2>\n",
      "  <p class=\"test\" id=\"num1\">\n",
      "   我爱学习\n",
      "  </p>\n",
      "  <p class=\"test2\" id=\"num2\">\n",
      "   学习爱我\n",
      "  </p>\n",
      "  <p class=\"test\" id=\"num3\">\n",
      "   学习CSS\n",
      "  </p>\n",
      " </body>\n",
      "</html>\n",
      "\n"
     ]
    }
   ],
   "source": [
    "html = '''\n",
    "<!DOCTYPE html>\n",
    "<html>\n",
    "<head>\n",
    "<meta charset=\"UTF-8\">\n",
    "<title>second</title>\n",
    "<style>\n",
    "*{\n",
    "text-align: center;\n",
    "color: red;\n",
    "}\n",
    "</style>\n",
    "</head>\n",
    "\n",
    "<body>\n",
    " <h2>美丽的汤</h2>\n",
    "<p class=\"test\" id='num1'>我爱学习</p>\n",
    "<p class=\"test2\" id='num2'>学习爱我</p>\n",
    "<p class=\"test\" id='num3'>学习CSS</p>\n",
    "</body>\n",
    "</html>\n",
    "'''\n",
    "from bs4 import BeautifulSoup\n",
    "\n",
    "soup = BeautifulSoup(html, 'lxml')\n",
    "\n",
    "print(soup.prettify())  # prettify可以打印格式很好的html"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "second\n"
     ]
    }
   ],
   "source": [
    "t=soup.title.string\n",
    "print(t)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[<p class=\"test\" id=\"num1\">我爱学习</p>, <p class=\"test2\" id=\"num2\">学习爱我</p>, <p class=\"test\" id=\"num3\">学习CSS</p>]\n"
     ]
    }
   ],
   "source": [
    "p2=soup.find_all('p')\n",
    "print(p2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "美丽的汤\n"
     ]
    }
   ],
   "source": [
    "h=soup.h2.string\n",
    "print(h)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "我爱学习\n"
     ]
    }
   ],
   "source": [
    "p=soup.p.string\n",
    "print(p)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "学习爱我\n"
     ]
    }
   ],
   "source": [
    "p3=p2[1].string\n",
    "print(p3)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "学习爱我\n",
      "学习爱我\n"
     ]
    }
   ],
   "source": [
    "p3=p2[1].string\n",
    "print(p3)\n",
    "p4=p2[1].get_text()\n",
    "print(p4)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 属性"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<!DOCTYPE html>\n",
      "<html>\n",
      " <head>\n",
      "  <meta charset=\"utf-8\"/>\n",
      "  <title>\n",
      "   属性\n",
      "  </title>\n",
      " </head>\n",
      " <body>\n",
      "  <a class=\"one\" href=\"https://www.csdn.net/\">\n",
      "   红豆生南国，春来发几枝。\n",
      "  </a>\n",
      "  <a href=\"https://www.zhihu.com/\" id=\"two\">\n",
      "   愿君多采撷，此物最相思。\n",
      "  </a>\n",
      " </body>\n",
      "</html>\n",
      "\n"
     ]
    }
   ],
   "source": [
    "text='''\n",
    "<!DOCTYPE html>\n",
    "<html>\n",
    "<head>\n",
    "<meta charset=\"UTF-8\">\n",
    "<title>属性</title>\n",
    "\n",
    "</head>\n",
    "<body>\n",
    "<a href='https://www.csdn.net/' class=\"one\" >红豆生南国，春来发几枝。</a>\n",
    "\n",
    "<a href='https://www.zhihu.com/' id=\"two\">愿君多采撷，此物最相思。</a>\n",
    "</body>\n",
    "</html>\n",
    "'''\n",
    "from bs4 import BeautifulSoup\n",
    "\n",
    "soup = BeautifulSoup(text, 'lxml')\n",
    "\n",
    "print(soup.prettify()) "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "https://www.csdn.net/\n",
      "['one']\n"
     ]
    }
   ],
   "source": [
    "s=soup.a\n",
    "# print(s)\n",
    "s2=s.get('href')\n",
    "print(s2)\n",
    "\n",
    "s3=s.get('class')\n",
    "print(s3)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 基本使用"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<!DOCTYPE html>\n",
      "<html>\n",
      " <head>\n",
      "  <meta charset=\"utf-8\"/>\n",
      "  <title>\n",
      "   second\n",
      "  </title>\n",
      "  <style>\n",
      "   *{\n",
      "text-align: center;\n",
      "color: red;\n",
      "}\n",
      "  </style>\n",
      " </head>\n",
      " <body>\n",
      "  <h2>\n",
      "   美丽的汤\n",
      "  </h2>\n",
      "  <p class=\"test\" id=\"num1\">\n",
      "   我爱学习\n",
      "  </p>\n",
      "  <p class=\"test2\" id=\"num2\">\n",
      "   学习爱我\n",
      "  </p>\n",
      "  <p class=\"test\" id=\"num3\">\n",
      "   学习CSS\n",
      "  </p>\n",
      " </body>\n",
      "</html>\n",
      "\n"
     ]
    }
   ],
   "source": [
    "html = '''\n",
    "<!DOCTYPE html>\n",
    "<html>\n",
    "<head>\n",
    "<meta charset=\"UTF-8\">\n",
    "<title>second</title>\n",
    "<style>\n",
    "*{\n",
    "text-align: center;\n",
    "color: red;\n",
    "}\n",
    "</style>\n",
    "</head>\n",
    "\n",
    "<body>\n",
    " <h2>美丽的汤</h2>\n",
    "<p class=\"test\" id='num1'>我爱学习</p>\n",
    "<p class=\"test2\" id='num2'>学习爱我</p>\n",
    "<p class=\"test\" id='num3'>学习CSS</p>\n",
    "</body>\n",
    "</html>\n",
    "'''\n",
    "from bs4 import BeautifulSoup\n",
    "\n",
    "soup = BeautifulSoup(html, 'lxml')\n",
    "\n",
    "print(soup.prettify())  # prettify可以打印格式很好的html"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[<p class=\"test\" id=\"num1\">我爱学习</p>, <p class=\"test2\" id=\"num2\">学习爱我</p>, <p class=\"test\" id=\"num3\">学习CSS</p>]\n"
     ]
    }
   ],
   "source": [
    "p2=soup.find_all('p')\n",
    "print(p2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "学习爱我\n"
     ]
    }
   ],
   "source": [
    "p3=p2[1].string\n",
    "print(p3)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 案例二"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<html>\n",
      " <head>\n",
      "  <meta charset=\"utf-8\"/>\n",
      "  <title>\n",
      "   再来一碗美丽的汤\n",
      "  </title>\n",
      " </head>\n",
      " <body>\n",
      "  <h2>\n",
      "   崔九欲往南山马上口号与别\n",
      "  </h2>\n",
      "  <p>\n",
      "   归山深浅去\n",
      "  </p>\n",
      "  <a href=\"https://www.baidu.com/\" id=\"link1\">\n",
      "   须尽丘壑美。\n",
      "  </a>\n",
      "  <a href=\"https://cn.bing.com/\" id=\"link2\">\n",
      "   莫学武陵人\n",
      "  </a>\n",
      "  <p>\n",
      "   暂游桃源里。\n",
      "   <b class=\"boldtext\">\n",
      "    这是一首诗\n",
      "   </b>\n",
      "   <b class=\"boldtext2\">\n",
      "    唐代的诗歌\n",
      "   </b>\n",
      "  </p>\n",
      " </body>\n",
      "</html>\n",
      "\n"
     ]
    }
   ],
   "source": [
    "html='''\n",
    "<html>\n",
    " <head>\n",
    " \t<meta charset=\"UTF-8\">\n",
    "  <title>再来一碗美丽的汤</title>\n",
    " </head>\n",
    " <body>\n",
    "  <h2>\n",
    "   崔九欲往南山马上口号与别\n",
    "  </h2>\n",
    "  \n",
    "  <p>\n",
    "  归山深浅去\n",
    "  </p>\n",
    "  <a href=\"https://www.baidu.com/\" id=\"link1\">\n",
    "  须尽丘壑美。\n",
    "  </a>\n",
    "  <a href=\"https://cn.bing.com/\" id=\"link2\">\n",
    " 莫学武陵人\n",
    "  </a>\n",
    "  <p>\n",
    " 暂游桃源里。\n",
    "  <b class=\"boldtext\">\n",
    "    这是一首诗\n",
    "   </b>\n",
    "<b class=\"boldtext2\">\n",
    "     唐代的诗歌\n",
    "</b>\n",
    "  </p>\n",
    " </body>\n",
    "</html>\n",
    "'''\n",
    "\n",
    "from bs4 import BeautifulSoup\n",
    "\n",
    "soup = BeautifulSoup(html, 'lxml')\n",
    "\n",
    "print(soup.prettify())  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[<a href=\"https://www.baidu.com/\" id=\"link1\">\n",
      "  须尽丘壑美。\n",
      "  </a>, <a href=\"https://cn.bing.com/\" id=\"link2\">\n",
      " 莫学武陵人\n",
      "  </a>]\n"
     ]
    }
   ],
   "source": [
    "a=soup.find_all('a')\n",
    "print(a)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[<b class=\"boldtext\">\n",
      "    这是一首诗\n",
      "   </b>, <b class=\"boldtext2\">\n",
      "     唐代的诗歌\n",
      "</b>]\n"
     ]
    }
   ],
   "source": [
    "b=soup.find_all('b')\n",
    "print(b)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<b class=\"boldtext2\">\n",
      "     唐代的诗歌\n",
      "</b>\n"
     ]
    }
   ],
   "source": [
    "b2=b[1]\n",
    "print(b2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[<b class=\"boldtext2\">\n",
      "     唐代的诗歌\n",
      "</b>]\n"
     ]
    }
   ],
   "source": [
    "t=soup.titleb3=soup.find_all('b','boldtext2')\n",
    "print(b3)t=soup.title"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 标签搜素"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[<title>再来一碗美丽的汤</title>]\n"
     ]
    }
   ],
   "source": [
    "n = soup.find_all('title')\n",
    "print(n)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[<a href=\"https://www.baidu.com/\" id=\"link1\">\n",
      "  须尽丘壑美。\n",
      "  </a>]\n"
     ]
    }
   ],
   "source": [
    "n2=soup.find_all(id='link1')\n",
    "print(n2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "     唐代的诗歌\n",
      "\n"
     ]
    }
   ],
   "source": [
    "import re\n",
    "n3=soup.find(string=re.compile('诗歌'))\n",
    "print(n3)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[<title>再来一碗美丽的汤</title>, <p>\n",
      "  归山深浅去\n",
      "  </p>, <p>\n",
      " 暂游桃源里。\n",
      "  <b class=\"boldtext\">\n",
      "    这是一首诗\n",
      "   </b>\n",
      "<b class=\"boldtext2\">\n",
      "     唐代的诗歌\n",
      "</b>\n",
      "</p>]\n"
     ]
    }
   ],
   "source": [
    "n3 =soup.find_all(['title','p'])\n",
    "print(n3)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### ksw参数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[<a href=\"https://www.baidu.com/\" id=\"link1\">\n",
      "  须尽丘壑美。\n",
      "  </a>]\n"
     ]
    }
   ],
   "source": [
    "n2=soup.find_all(id='link1')\n",
    "print(n2)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## CSS获取"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<html>\n",
      " <body>\n",
      "  <p>\n",
      "   html_doc = \"\"\"\n",
      "  </p>\n",
      "  <title>\n",
      "   CSS获取\n",
      "  </title>\n",
      "  <p class=\"title\">\n",
      "   <b>\n",
      "   </b>\n",
      "  </p>\n",
      "  <p class=\"story\">\n",
      "   美人卷珠帘，\n",
      "  </p>\n",
      "  <a class=\"shi\" href=\"https://www.baidu.com/\" id=\"link1\">\n",
      "   深坐蹙蛾眉。\n",
      "  </a>\n",
      "  ,\n",
      "  <a class=\"shi\" href=\"https://cn.bing.com/\" id=\"link2\">\n",
      "   但见泪痕湿，\n",
      "  </a>\n",
      "  and\n",
      "  <a class=\"shi\" href=\"https://www.google.com/?hl=zh_CN\" id=\"link3\">\n",
      "   不知心恨谁。\n",
      "  </a>\n",
      "  ;\n",
      "and they lived at the bottom of a well.\n",
      "  <p class=\"story\">\n",
      "   ...\n",
      "  </p>\n",
      "  \"\"\"\n",
      " </body>\n",
      "</html>\n"
     ]
    }
   ],
   "source": [
    "html3='''\n",
    "html_doc = \"\"\"\n",
    "<html><head><title>CSS获取</title></head>\n",
    "<body>\n",
    "<p class=\"title\"><b></b></p>\n",
    "\n",
    "<p class=\"story\">美人卷珠帘，</p>\n",
    "\n",
    "<a href=\"https://www.baidu.com/\" class=\"shi\" id=\"link1\">深坐蹙蛾眉。</a>,\n",
    "<a href=\"https://cn.bing.com/\" class=\"shi\" id=\"link2\">但见泪痕湿，</a> and\n",
    "<a href=\"https://www.google.com/?hl=zh_CN\" class=\"shi\" id=\"link3\">不知心恨谁。</a>;\n",
    "and they lived at the bottom of a well.</p>\n",
    "\n",
    "<p class=\"story\">...</p>\n",
    "\"\"\"\n",
    "'''\n",
    "from bs4 import BeautifulSoup\n",
    "\n",
    "soup = BeautifulSoup(html3, 'lxml')\n",
    "\n",
    "print(soup.prettify()) "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[<a class=\"shi\" href=\"https://www.baidu.com/\" id=\"link1\">深坐蹙蛾眉。</a>, <a class=\"shi\" href=\"https://cn.bing.com/\" id=\"link2\">但见泪痕湿，</a>, <a class=\"shi\" href=\"https://www.google.com/?hl=zh_CN\" id=\"link3\">不知心恨谁。</a>]\n"
     ]
    }
   ],
   "source": [
    "c=soup.find_all('a',class_='shi')\n",
    "print(c)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[]\n"
     ]
    }
   ],
   "source": [
    "c2=soup.find_all(class_=re.compile(\"不知心恨谁。\"))\n",
    "print(c2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[<p class=\"story\">美人卷珠帘，</p>, <p class=\"story\">...</p>]\n"
     ]
    }
   ],
   "source": [
    "c3 =soup.find_all(\"p\", class_=\"story\")\n",
    "print(c3)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[<a class=\"shi\" href=\"https://cn.bing.com/\" id=\"link2\">但见泪痕湿，</a>]\n"
     ]
    }
   ],
   "source": [
    "c4 = soup.find_all(\"a\", id=\"link2\")\n",
    "print(c4)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 文本获取"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['但见泪痕湿，']\n"
     ]
    }
   ],
   "source": [
    "w = soup.find_all(string=\"但见泪痕湿，\")\n",
    "print(w)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['美人卷珠帘，']\n"
     ]
    }
   ],
   "source": [
    "w2 = soup.find_all(string=re.compile(\"美人\"))\n",
    "print(w2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[<a class=\"shi\" href=\"https://cn.bing.com/\" id=\"link2\">但见泪痕湿，</a>]\n"
     ]
    }
   ],
   "source": [
    "w3=  soup.find_all('a',string=\"但见泪痕湿，\")\n",
    "print(w3)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[<a class=\"shi\" href=\"https://www.google.com/?hl=zh_CN\" id=\"link3\">不知心恨谁。</a>]\n"
     ]
    }
   ],
   "source": [
    "w4=  soup.find_all('a',string=re.compile(\"不知\"))\n",
    "print(w4)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 输出限制"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[<a class=\"shi\" href=\"https://www.baidu.com/\" id=\"link1\">深坐蹙蛾眉。</a>, <a class=\"shi\" href=\"https://cn.bing.com/\" id=\"link2\">但见泪痕湿，</a>]\n"
     ]
    }
   ],
   "source": [
    "html3='''\n",
    "html_doc = \"\"\"\n",
    "<html><head><title>CSS获取</title></head>\n",
    "<body>\n",
    "<p class=\"title\"><b></b></p>\n",
    "\n",
    "<p class=\"story\">美人卷珠帘，</p>\n",
    "\n",
    "<a href=\"https://www.baidu.com/\" class=\"shi\" id=\"link1\">深坐蹙蛾眉。</a>,\n",
    "<a href=\"https://cn.bing.com/\" class=\"shi\" id=\"link2\">但见泪痕湿，</a> and\n",
    "<a href=\"https://www.google.com/?hl=zh_CN\" class=\"shi\" id=\"link3\">不知心恨谁。</a>;\n",
    "and they lived at the bottom of a well.</p>\n",
    "\n",
    "<p class=\"story\">...</p>\n",
    "\"\"\"\n",
    "'''\n",
    "from bs4 import BeautifulSoup\n",
    "\n",
    "soup = BeautifulSoup(html3, 'lxml')\n",
    "\n",
    "a = soup.find_all('a',limit=2)\n",
    "print(a)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<a class=\"shi\" href=\"https://www.baidu.com/\" id=\"link1\">深坐蹙蛾眉。</a>\n"
     ]
    }
   ],
   "source": [
    "a2=soup.find('a')\n",
    "print(a2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "None\n"
     ]
    }
   ],
   "source": [
    "a3= soup.find('a',recursive= False)\n",
    "print(a3)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## find的使用"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<html>\n",
      " <body>\n",
      "  <p>\n",
      "   html_doc = \"\"\"\n",
      "  </p>\n",
      "  <title>\n",
      "   CSS获取\n",
      "  </title>\n",
      "  <p class=\"title\">\n",
      "   <b>\n",
      "   </b>\n",
      "  </p>\n",
      "  <p class=\"story\">\n",
      "   美人卷珠帘，\n",
      "  </p>\n",
      "  <a class=\"shi\" href=\"https://www.baidu.com/\" id=\"link1\">\n",
      "   深坐蹙蛾眉。\n",
      "  </a>\n",
      "  ,\n",
      "  <a class=\"shi\" href=\"https://cn.bing.com/\" id=\"link2\">\n",
      "   但见泪痕湿，\n",
      "  </a>\n",
      "  and\n",
      "  <a class=\"shi\" href=\"https://www.google.com/?hl=zh_CN\" id=\"link3\">\n",
      "   不知心恨谁。\n",
      "  </a>\n",
      "  ;\n",
      "and they lived at the bottom of a well.\n",
      "  <p class=\"story\">\n",
      "   ...\n",
      "  </p>\n",
      "  \"\"\"\n",
      " </body>\n",
      "</html>\n"
     ]
    }
   ],
   "source": [
    "html3='''\n",
    "html_doc = \"\"\"\n",
    "<html><head><title>CSS获取</title></head>\n",
    "<body>\n",
    "<p class=\"title\"><b></b></p>\n",
    "\n",
    "<p class=\"story\">美人卷珠帘，</p>\n",
    "\n",
    "<a href=\"https://www.baidu.com/\" class=\"shi\" id=\"link1\">深坐蹙蛾眉。</a>,\n",
    "<a href=\"https://cn.bing.com/\" class=\"shi\" id=\"link2\">但见泪痕湿，</a> and\n",
    "<a href=\"https://www.google.com/?hl=zh_CN\" class=\"shi\" id=\"link3\">不知心恨谁。</a>;\n",
    "and they lived at the bottom of a well.</p>\n",
    "\n",
    "<p class=\"story\">...</p>\n",
    "\"\"\"\n",
    "'''\n",
    "from bs4 import BeautifulSoup\n",
    "\n",
    "soup = BeautifulSoup(html3, 'lxml')\n",
    "\n",
    "print(soup.prettify()) "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[<title>CSS获取</title>]\n",
      "<title>CSS获取</title>\n"
     ]
    }
   ],
   "source": [
    "s=soup.find_all('title',limit=1)\n",
    "s2=soup.find('title')\n",
    "print(s)\n",
    "print(s2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[]\n",
      "None\n"
     ]
    }
   ],
   "source": [
    "s3=soup.find_all('efe')\n",
    "print(s3)\n",
    "s4=soup.find('dv')\n",
    "print(s4)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<a class=\"shi\" href=\"https://www.baidu.com/\" id=\"link1\">深坐蹙蛾眉。</a>\n",
      "<a class=\"shi\" href=\"https://www.baidu.com/\" id=\"link1\">深坐蹙蛾眉。</a>\n"
     ]
    }
   ],
   "source": [
    "s5=soup.find('body').find('a')\n",
    "print(s5)\n",
    "\n",
    "s6=soup.body.a\n",
    "print(s6)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 网页文档处理"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<!DOCTYPE html>\n",
      "<html>\n",
      " <head>\n",
      "  <meta charset=\"utf-8\"/>\n",
      "  <title>\n",
      "   second\n",
      "  </title>\n",
      "  <style>\n",
      "   *{\n",
      "\t\t\t\ttext-align: center;\n",
      "\t\t\t\tcolor: red;\n",
      "\t\t\t}\n",
      "  </style>\n",
      " </head>\n",
      " <body>\n",
      "  <p class=\"test\" id=\"num1\">\n",
      "   鎴戠埍瀛︿範\n",
      "  </p>\n",
      "  <p class=\"test2\" id=\"num2\">\n",
      "   瀛︿範鐖辨垜\n",
      "  </p>\n",
      "  <p class=\"test\" id=\"num3\">\n",
      "   瀛︿範CSS\n",
      "  </p>\n",
      " </body>\n",
      "</html>\n"
     ]
    }
   ],
   "source": [
    "from bs4 import BeautifulSoup\n",
    "# 从档案读取HTML文档处理\n",
    "with  open ( \"index.html \" ) as f: \n",
    "    soup = BeautifulSoup(f)\n",
    "print(soup.prettify()) "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## CSS选择器"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<html>\n",
      " <body>\n",
      "  <p>\n",
      "   html_doc = \"\"\"\n",
      "  </p>\n",
      "  <title>\n",
      "   CSS获取\n",
      "  </title>\n",
      "  <p class=\"title\">\n",
      "   <b>\n",
      "   </b>\n",
      "  </p>\n",
      "  <p class=\"story\">\n",
      "   美人卷珠帘，\n",
      "  </p>\n",
      "  <a class=\"shi1\" href=\"https://www.baidu.com/\" id=\"link1\">\n",
      "   深坐蹙蛾眉。\n",
      "  </a>\n",
      "  ,\n",
      "  <a class=\"shi\" href=\"https://cn.bing.com/\" id=\"link2\">\n",
      "   但见泪痕湿，\n",
      "  </a>\n",
      "  and\n",
      "  <a class=\"shi2\" href=\"https://www.google.com/?hl=zh_CN\" id=\"link3\">\n",
      "   不知心恨谁。\n",
      "  </a>\n",
      "  \"\"\"\n",
      " </body>\n",
      "</html>\n"
     ]
    }
   ],
   "source": [
    "html4='''\n",
    "html_doc = \"\"\"\n",
    "<html><head><title>CSS获取</title></head>\n",
    "<body>\n",
    "<p class=\"title\"><b></b></p>\n",
    "\n",
    "<p class=\"story\">美人卷珠帘，</p>\n",
    "\n",
    "<a href=\"https://www.baidu.com/\" class=\"shi1\" id=\"link1\">深坐蹙蛾眉。</a>,\n",
    "<a href=\"https://cn.bing.com/\" class=\"shi\" id=\"link2\">但见泪痕湿，</a> and\n",
    "<a href=\"https://www.google.com/?hl=zh_CN\" class=\"shi2\" id=\"link3\">不知心恨谁。</a>\n",
    "\"\"\"\n",
    "'''\n",
    "from bs4 import BeautifulSoup\n",
    "\n",
    "soup = BeautifulSoup(html4, 'lxml')\n",
    "\n",
    "print(soup.prettify()) "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[<title>CSS获取</title>]\n"
     ]
    }
   ],
   "source": [
    "s=soup.select('title')\n",
    "print(s)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[<a class=\"shi1\" href=\"https://www.baidu.com/\" id=\"link1\">深坐蹙蛾眉。</a>, <a class=\"shi\" href=\"https://cn.bing.com/\" id=\"link2\">但见泪痕湿，</a>, <a class=\"shi2\" href=\"https://www.google.com/?hl=zh_CN\" id=\"link3\">不知心恨谁。</a>]\n"
     ]
    }
   ],
   "source": [
    "s=soup.select('a')\n",
    "print(s)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[<title>CSS获取</title>]\n"
     ]
    }
   ],
   "source": [
    "s2=soup.select('body title')\n",
    "print(s2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[<a class=\"shi1\" href=\"https://www.baidu.com/\" id=\"link1\">深坐蹙蛾眉。</a>, <a class=\"shi\" href=\"https://cn.bing.com/\" id=\"link2\">但见泪痕湿，</a>, <a class=\"shi2\" href=\"https://www.google.com/?hl=zh_CN\" id=\"link3\">不知心恨谁。</a>]\n"
     ]
    }
   ],
   "source": [
    "s2=soup.select('body a')\n",
    "print(s2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[<a class=\"shi1\" href=\"https://www.baidu.com/\" id=\"link1\">深坐蹙蛾眉。</a>, <a class=\"shi\" href=\"https://cn.bing.com/\" id=\"link2\">但见泪痕湿，</a>, <a class=\"shi2\" href=\"https://www.google.com/?hl=zh_CN\" id=\"link3\">不知心恨谁。</a>]\n"
     ]
    }
   ],
   "source": [
    "s2=soup.select('body>a')\n",
    "print(s2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[<a class=\"shi\" href=\"https://cn.bing.com/\" id=\"link2\">但见泪痕湿，</a>]\n"
     ]
    }
   ],
   "source": [
    "s3=soup.select(\"body > #link2\")\n",
    "print(s3)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 47,
   "metadata": {},
   "outputs": [],
   "source": [
    "#按照类名查找"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[<a class=\"shi2\" href=\"https://www.google.com/?hl=zh_CN\" id=\"link3\">不知心恨谁。</a>]\n"
     ]
    }
   ],
   "source": [
    "s4=soup.select(\".shi2\")\n",
    "print(s4)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 49,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[<a class=\"shi1\" href=\"https://www.baidu.com/\" id=\"link1\">深坐蹙蛾眉。</a>]\n"
     ]
    }
   ],
   "source": [
    "s5=soup.select(\".shi1\")\n",
    "print(s5)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 50,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[<a class=\"shi\" href=\"https://cn.bing.com/\" id=\"link2\">但见泪痕湿，</a>]\n"
     ]
    }
   ],
   "source": [
    "s6=soup.select(\"#link2\")\n",
    "print(s6)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 51,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[<a class=\"shi2\" href=\"https://www.google.com/?hl=zh_CN\" id=\"link3\">不知心恨谁。</a>]\n"
     ]
    }
   ],
   "source": [
    "s7=soup.select(\"#link3\")\n",
    "print(s7)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 52,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[<a class=\"shi1\" href=\"https://www.baidu.com/\" id=\"link1\">深坐蹙蛾眉。</a>, <a class=\"shi\" href=\"https://cn.bing.com/\" id=\"link2\">但见泪痕湿，</a>]\n"
     ]
    }
   ],
   "source": [
    "s8=soup.select(\"#link1,#link2\")\n",
    "print(s8)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[<a class=\"shi1\" href=\"https://www.baidu.com/\" id=\"link1\">深坐蹙蛾眉。</a>, <a class=\"shi\" href=\"https://cn.bing.com/\" id=\"link2\">但见泪痕湿，</a>, <a class=\"shi2\" href=\"https://www.google.com/?hl=zh_CN\" id=\"link3\">不知心恨谁。</a>]\n"
     ]
    }
   ],
   "source": [
    "shu=soup.select('a[href]')\n",
    "print(shu)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 54,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[<a class=\"shi1\" href=\"https://www.baidu.com/\" id=\"link1\">深坐蹙蛾眉。</a>]\n"
     ]
    }
   ],
   "source": [
    "shu2=soup.select('a[href=\"https://www.baidu.com/\"]')\n",
    "print(shu2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 55,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "深坐蹙蛾眉。\n",
      "深坐蹙蛾眉。\n"
     ]
    }
   ],
   "source": [
    "shu3=soup.select('a[href=\"https://www.baidu.com/\"]')[0]\n",
    "print(shu3.get_text())\n",
    "print(shu3.string)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 实战一"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 56,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<!DOCTYPE html>\n",
      "<html lang=\"zh\">\n",
      "<head>\n",
      "\t<script type=\"text/javascript\" src=\"https://ip.ws.126.net/ipquery\"></script>\n",
      "    <script src=\"/newpage/js/all.js\"></script>\n",
      "    <meta charset=\"UTF-8\">\n",
      "    <title>《红楼梦》全集在线阅读_史书典籍_诗词名句网</title>\n",
      "    <meta name=\"viewport\" content=\"width=device-width,user-scalable=no\" />\n",
      "    <meta name=\"description\" content=\"\" />\n",
      "    <link rel=\"stylesheet\" href=\"/public/css/www_v3.css\">\n",
      "    <link rel=\"stylesheet\" href=\"/public/css/font_576092_m2icqcebp7evzpvi.css\">\n",
      "    <script src=\"/public/js/device.js\"></script>\n",
      "    <script src=\"/public/js/jq.js\"></script>\n",
      "    <script src=\"/public/js/www_v3.js\"></script>\n",
      "</head>\n",
      "<body>\n",
      "<div id=\"top_bar\">\n",
      "    <div id=\"top_bar_main\">\n",
      "        <div id=\"top_left\">\n",
      "            <a href=\"/\"><img src=\"/public/image/logo.png\" id=\"logo\"/></a>\n",
      "            <div id=\"top_left_menu\">\n",
      "                <ul>\n",
      "                    <li><a href=\"/\">首页</a></li>\n",
      "                    <li><a href=\"/shicimark\">分类</a></li>\n",
      "                    <li><a href=\"/category/all\">作者</a></li>\n",
      "                    <li><a href=\"/paiming\">排行榜</a></li>\n",
      "                    <li><a href=\"/cate?cate_id=4\">课本古诗</a></li>\n",
      "                    <li><a href=\"/cipai/index.html\">词牌名</a></li>\n",
      "                    <li><a href=\"/cangtoushi/index.html\">藏头诗</a></li>\n",
      "                    <li><a href=\"/hecheng/index.html\">合称</a></li>\n",
      "                    <li><a href=\"/book/\">古籍</a></li>\n",
      "\t\t    <li><a href=\"/app/\">安卓下载</a></li>\n",
      "                </ul>\n",
      "            </div>\n",
      "            <div style=\"clear: both\"></div>\n",
      "        </div>\n",
      "        <div id=\"top_right\">\n",
      "            <div id=\"top_right_nav\">\n",
      "                <ul>\n",
      "                    <li><a href=\"javascript:void(0)\" data-cate=\"all\">综合</a> </li>\n",
      "                    <li><a href=\"javascript:void(0)\" data-cate=\"zuozhe\">作者</a> </li>\n",
      "                    <li><a href=\"javascript:void(0)\" data-cate=\"title\">标题</a> </li>\n",
      "                    <li><a href=\"javascript:void(0)\" data-cate=\"shiju\">诗句</a> </li>\n",
      "                    <li><a href=\"javascript:void(0)\" data-cate=\"first\">句首</a> </li>\n",
      "                    <li><a href=\"javascript:void(0)\" data-cate=\"end\">句尾</a> </li>\n",
      "                    <li><a href=\"javascript:void(0)\" data-cate=\"book\">古籍</a> </li>\n",
      "                    <li><a href=\"javascript:void(0)\" data-cate=\"chengyu\">成语</a> </li>\n",
      "                </ul>\n",
      "            </div>\n",
      "            <div id=\"input_div\">\n",
      "                <input type=\"text\" name=\"kw\" id=\"search_input\" placeholder=\"\" autocomplete=\"off\" value=\"\">\n",
      "                <a href=\"javascript:doSearch();\"><img src=\"/public/image/web_search.png\" class=\"www-icon\"></a>\n",
      "                <div style=\"clear: both\"></div>\n",
      "            </div>\n",
      "            <div id=\"tip_result\" class=\"card\">\n",
      "                <ul>\n",
      "                </ul>\n",
      "                <div id=\"tip_content\">\n",
      "                </div>\n",
      "            </div>\n",
      "        </div>\n",
      "        <div style=\"clear: both;\"></div>\n",
      "    </div>\n",
      "</div>\n",
      "\n",
      "<div id=\"nav-top\"><a href=\"/\">主页</a><span class=\"nav-arrow\"></span><a href=\"/book/index.html\">史书典籍</a><span class=\"nav-arrow\"></span><a href=\"/book/sidamingzhu.html\">四大名著</a></div>\n",
      "\n",
      "<div id=\"main\">\n",
      "    <div id=\"main_left\">\n",
      "        <div class=\"card bookmark-list\">\n",
      "            <h1>《红楼梦》</h1>\n",
      "            <div>\n",
      "                                <img src=\"/public/image/book/hongloumeng.jpg\" class=\"book-img\">\n",
      "                                                <p>年代：清</p>\n",
      "                                <p>作者：曹雪芹、高鹗</p>\n",
      "                <p class=\"des\"> 《红楼梦》，中国古典四大名著之首，清代作家曹雪芹创作的章回体长篇小说。早期仅有前八十回抄本流传，原名《石头记》。程伟元搜集到后四十回残稿，邀请高鹗协同整理出版百二十回全本，定名《红楼梦》。亦有版本作《金玉缘》《脂砚斋重评石头记》。<br/>\r\n",
      "《红楼梦》是一部具有世界影响力的伟大作品，举世公认的中国古典小说巅峰之作，中国封建社会的百科全书，传统文化的集大成者。小说以贾、王、史、薛四大家族的兴衰为背景，以贾府的家庭琐事、闺阁闲情为中心，以贾宝玉、林黛玉、薛宝钗的爱情婚姻故事为主线，描写了金陵十二钗的人性美和悲剧美，歌颂追求光明的叛逆人物，通过叛逆者的悲剧命运预见封建社会必然走向灭亡，揭示出封建末世危机。</p>\n",
      "                <div style=\"clear: both\"></div>\n",
      "            </div>\n",
      "            <div>\n",
      "                <form method=\"get\" action=\"/book/chaxun/\" style=\"float: right;\">\n",
      "                    <input type=\"hidden\" name=\"book_id\" value=\"4\">\n",
      "                    <input type=\"text\" name=\"kw\" placeholder=\"全文检索\" autocomplete=\"off\">\n",
      "                </form>\n",
      "                <div style=\"clear: both\"></div>\n",
      "            </div>\n",
      "            <div class=\"line\"></div>\n",
      "            <div class=\"book-mulu\">\n",
      "                <ul>\n",
      "                    <li><a href=\"/book/hongloumeng/1.html\">第 一 回 甄士隐梦幻识通灵 贾雨村风尘怀闺秀</a></li><li><a href=\"/book/hongloumeng/2.html\">第 二 回 贾夫人仙逝扬州城 冷子兴演说荣国府</a></li><li><a href=\"/book/hongloumeng/3.html\">第 三 回 托内兄如海酬训教 接外孙贾母惜孤女</a></li><li><a href=\"/book/hongloumeng/4.html\">第 四 回 薄命女偏逢薄命郎 葫芦僧乱判葫芦案</a></li><li><a href=\"/book/hongloumeng/5.html\">第 五 回 游幻境指迷十二钗 饮仙醪曲演红楼梦</a></li><li><a href=\"/book/hongloumeng/6.html\">第 六 回 贾宝玉初试云雨情 刘姥姥一进荣国府</a></li><li><a href=\"/book/hongloumeng/7.html\">第 七 回 送宫花贾琏戏熙凤 宴宁府宝玉会秦钟</a></li><li><a href=\"/book/hongloumeng/8.html\">第 八 回 比通灵金莺微露意 探宝钗黛玉半含酸</a></li><li><a href=\"/book/hongloumeng/9.html\">第 九 回 恋风流情友入家塾 起嫌疑顽童闹学堂</a></li><li><a href=\"/book/hongloumeng/10.html\">第 十 回 金寡妇贪利权受辱 张太医论病细穷源</a></li><li><a href=\"/book/hongloumeng/11.html\">第十一回 庆寿辰宁府排家宴 见熙凤贾瑞起淫心</a></li><li><a href=\"/book/hongloumeng/12.html\">第十二回 王熙凤毒设相思局 贾天祥正照</a></li><li><a href=\"/book/hongloumeng/13.html\">第十三回 秦可卿死封龙禁尉 王熙凤协理宁国府</a></li><li><a href=\"/book/hongloumeng/14.html\">第十四回 林如海捐馆扬州城 贾宝玉路谒北静王</a></li><li><a href=\"/book/hongloumeng/15.html\">第十五回 王凤姐弄权铁槛寺 秦鲸卿得趣馒头庵</a></li><li><a href=\"/book/hongloumeng/16.html\">第十六回 贾元春才选凤藻宫 秦鲸卿夭逝黄泉路</a></li><li><a href=\"/book/hongloumeng/17.html\">第十七回 大观园试才题对额 荣国府归省庆元宵</a></li><li><a href=\"/book/hongloumeng/18.html\">第十八回 隔珠帘父女勉忠勤 搦湘管姊弟裁题咏</a></li><li><a href=\"/book/hongloumeng/19.html\">第十九回 情切切良宵花解语 意绵绵静日玉生香</a></li><li><a href=\"/book/hongloumeng/20.html\">第二十回 王熙凤正言弹妒意 林黛玉俏语谑娇音</a></li><li><a href=\"/book/hongloumeng/21.html\">第二十一回 贤袭人娇嗔箴宝玉 俏平儿软语救贾琏</a></li><li><a href=\"/book/hongloumeng/22.html\">第二十二回 听曲文宝玉悟禅机 制灯谜贾政悲谶语</a></li><li><a href=\"/book/hongloumeng/23.html\">第二十三回 西厢记妙词通戏语 牡丹亭艳曲警芳心</a></li><li><a href=\"/book/hongloumeng/24.html\">第二十四回 醉金刚轻财尚义侠 痴女儿遗帕惹相思</a></li><li><a href=\"/book/hongloumeng/25.html\">第二十五回 魇魔法叔嫂逢五鬼 红楼梦通灵遇双真</a></li><li><a href=\"/book/hongloumeng/26.html\">第二十六回 蜂腰桥设言传密意 馆春困发幽情</a></li><li><a href=\"/book/hongloumeng/27.html\">第二十七回 滴翠亭杨妃戏彩蝶 埋香冢飞燕泣残红</a></li><li><a href=\"/book/hongloumeng/28.html\">第二十八回 蒋玉菡情赠茜香罗 薛宝钗羞笼红麝串</a></li><li><a href=\"/book/hongloumeng/29.html\">第二十九回 享福人福深还祷福 痴情女情重愈斟情</a></li><li><a href=\"/book/hongloumeng/30.html\">第三十回 宝钗借扇机带双敲 龄官划蔷痴及局外</a></li><li><a href=\"/book/hongloumeng/31.html\">第三十一回 撕扇子作千金一笑 因麒麟伏白首双星</a></li><li><a href=\"/book/hongloumeng/32.html\">第三十二回 诉肺腑心迷活宝玉 含耻辱情烈死金钏</a></li><li><a href=\"/book/hongloumeng/33.html\">第三十三回 手足眈眈小动唇舌 不肖种种大承笞挞</a></li><li><a href=\"/book/hongloumeng/34.html\">第三十四回 情中情因情感妹妹 错里错以错劝哥哥</a></li><li><a href=\"/book/hongloumeng/35.html\">第三十五回 白玉钏亲尝莲叶羹 黄金莺巧结梅花络</a></li><li><a href=\"/book/hongloumeng/36.html\">第三十六回 绣鸳鸯梦兆绛芸轩 识分定情悟梨香院</a></li><li><a href=\"/book/hongloumeng/37.html\">第三十七回 秋爽斋偶结海棠社 蘅芜苑夜拟菊花题</a></li><li><a href=\"/book/hongloumeng/38.html\">第三十八回 林魁夺菊花诗 薛蘅芜讽和螃蟹咏</a></li><li><a href=\"/book/hongloumeng/39.html\">第三十九回 村姥姥是信口开河 情哥哥偏寻根究底</a></li><li><a href=\"/book/hongloumeng/40.html\">第四十回 史太君两宴大观园 金鸳鸯三宣牙牌令</a></li><li><a href=\"/book/hongloumeng/41.html\">第四十一回 贾宝玉品茶栊翠庵 刘姥姥醉卧怡红院</a></li><li><a href=\"/book/hongloumeng/42.html\">第四十二回 蘅芜君兰言解疑癖 子雅谑补馀香</a></li><li><a href=\"/book/hongloumeng/43.html\">第四十三回 闲取乐偶攒金庆寿 不了情暂撮土为香</a></li><li><a href=\"/book/hongloumeng/44.html\">第四十四回 变生不测凤姐泼醋 喜出望外平儿理妆</a></li><li><a href=\"/book/hongloumeng/45.html\">第四十五回 金兰契互剖金兰语 风雨夕闷制风雨词</a></li><li><a href=\"/book/hongloumeng/46.html\">第四十六回 尴尬人难免尴尬事 鸳鸯女誓绝鸳鸯偶</a></li><li><a href=\"/book/hongloumeng/47.html\">第四十七回 呆霸王调情遭苦打 冷郎君惧祸走他乡</a></li><li><a href=\"/book/hongloumeng/48.html\">第四十八回 滥情人情误思游艺 慕雅女雅集苦吟诗</a></li><li><a href=\"/book/hongloumeng/49.html\">第四十九回 琉璃世界白雪红梅 脂粉香娃割腥啖膻</a></li><li><a href=\"/book/hongloumeng/50.html\">第五十回 芦雪庵争联即景诗 暖香坞雅制春灯谜</a></li><li><a href=\"/book/hongloumeng/51.html\">第五十一回 薛小妹新编怀古诗 胡庸医乱用虎狼药</a></li><li><a href=\"/book/hongloumeng/52.html\">第五十二回 俏平儿情掩虾须镯 勇晴雯病补雀金裘</a></li><li><a href=\"/book/hongloumeng/53.html\">第五十三回 宁国府除夕祭宗祠 荣国府元宵开夜宴</a></li><li><a href=\"/book/hongloumeng/54.html\">第五十四回 史太君破陈腐旧套 王熙凤效戏彩斑衣</a></li><li><a href=\"/book/hongloumeng/55.html\">第五十五回 辱亲女愚妾争闲气 欺幼主刁奴蓄险心</a></li><li><a href=\"/book/hongloumeng/56.html\">第五十六回 敏探春兴利除宿弊 识宝钗小惠全大体</a></li><li><a href=\"/book/hongloumeng/57.html\">第五十七回 慧紫鹃情辞试忙玉 慈姨妈爱语慰痴颦</a></li><li><a href=\"/book/hongloumeng/58.html\">第五十八回 杏子阴假凤泣虚凰 茜纱窗真情揆痴理</a></li><li><a href=\"/book/hongloumeng/59.html\">第五十九回 柳叶渚边嗔莺咤燕 绛芸轩里召将飞符</a></li><li><a href=\"/book/hongloumeng/60.html\">第六十回 茉莉粉替去蔷薇硝 玫瑰露引来茯苓霜</a></li><li><a href=\"/book/hongloumeng/61.html\">第六十一回 投鼠忌器宝玉瞒赃 判冤决狱平儿行权</a></li><li><a href=\"/book/hongloumeng/62.html\">第六十二回 憨湘云醉眠芍药裀 呆香菱情解石榴裙</a></li><li><a href=\"/book/hongloumeng/63.html\">第六十三回 寿怡红群芳开夜宴 死金丹独艳理亲丧</a></li><li><a href=\"/book/hongloumeng/64.html\">第六十四回 幽淑女悲题五美吟 浪荡子情遗九龙佩</a></li><li><a href=\"/book/hongloumeng/65.html\">第六十五回 贾二舍偷娶尤二姨 尤三姐思嫁柳二郎</a></li><li><a href=\"/book/hongloumeng/66.html\">第六十六回 情小妹耻情归地府 冷二郎一冷入空门</a></li><li><a href=\"/book/hongloumeng/67.html\">第六十七回 见土仪颦卿思故里 闻秘事凤姐讯家童</a></li><li><a href=\"/book/hongloumeng/68.html\">第六十八回 苦尤娘赚入大观园 酸凤姐大闹宁国府</a></li><li><a href=\"/book/hongloumeng/69.html\">第六十九回 弄小巧用借剑杀人 觉大限吞生金自逝</a></li><li><a href=\"/book/hongloumeng/70.html\">第七十回 林黛玉重建桃花社 史湘云偶填柳絮词</a></li><li><a href=\"/book/hongloumeng/71.html\">第七十一回 嫌隙人有心生嫌隙 鸳鸯女无意遇鸳鸯</a></li><li><a href=\"/book/hongloumeng/72.html\">第七十二回 王熙凤恃强羞说病 来旺妇倚势霸成亲</a></li><li><a href=\"/book/hongloumeng/73.html\">第七十三回 痴丫头误拾绣春囊 懦小姐不问累金凤</a></li><li><a href=\"/book/hongloumeng/74.html\">第七十四回 惑奸谗抄检大观园 矢孤介杜绝宁国府</a></li><li><a href=\"/book/hongloumeng/75.html\">第七十五回 开夜宴异兆发悲音 赏中秋新词得佳谶</a></li><li><a href=\"/book/hongloumeng/76.html\">第七十六回 凸碧堂品笛感凄清 凹晶馆联诗悲寂寞</a></li><li><a href=\"/book/hongloumeng/77.html\">第七十七回 俏丫鬟抱屈夭风流 美优伶斩情归水月</a></li><li><a href=\"/book/hongloumeng/78.html\">第七十八回 老学士闲徵姽嫿词 痴公子杜撰芙蓉诔</a></li><li><a href=\"/book/hongloumeng/79.html\">第七十九回 薛文龙悔娶河东狮 贾迎春误嫁中山狼</a></li><li><a href=\"/book/hongloumeng/80.html\">第八十回 美香菱屈受贪夫棒 王道士胡诌妒妇方</a></li><li><a href=\"/book/hongloumeng/81.html\">第八十一回 占旺相四美钓游鱼 奉严词两番入家塾</a></li><li><a href=\"/book/hongloumeng/82.html\">第八十二回 老学究讲义警顽心病痴魂惊恶梦</a></li><li><a href=\"/book/hongloumeng/83.html\">第八十三回 省宫闱贾元妃染恙 闹闺阃薛宝钗吞声</a></li><li><a href=\"/book/hongloumeng/84.html\">第八十四回 试文字宝玉始提亲 探惊风贾环重结怨</a></li><li><a href=\"/book/hongloumeng/85.html\">第八十五回 贾存周报升郎中任 薛文起复惹放流刑</a></li><li><a href=\"/book/hongloumeng/86.html\">第八十六回 受私贿老官翻案牍 寄闲情淑女解琴书</a></li><li><a href=\"/book/hongloumeng/87.html\">第八十七回 感秋声抚琴悲往事 坐禅寂走火入邪魔</a></li><li><a href=\"/book/hongloumeng/88.html\">第八十八回 博庭欢宝玉赞孤儿 正家法贾珍鞭悍仆</a></li><li><a href=\"/book/hongloumeng/89.html\">第八十九回 人亡物在公子填词 蛇影杯弓颦卿绝粒</a></li><li><a href=\"/book/hongloumeng/90.html\">第九十回 失绵衣贫女耐嗷嘈 送果品小郎惊叵测</a></li><li><a href=\"/book/hongloumeng/91.html\">第九十一回 纵淫心宝蟾工设计 布疑阵宝玉妄谈禅</a></li><li><a href=\"/book/hongloumeng/92.html\">第九十二回 评女传巧姐慕贤良 顽母珠贾政参聚散</a></li><li><a href=\"/book/hongloumeng/93.html\">第九十三回 甄家仆投靠贾家门 水月庵掀翻风月案</a></li><li><a href=\"/book/hongloumeng/94.html\">第九十四回 宴海棠贾母赏花妖 失宝玉通灵知奇祸</a></li><li><a href=\"/book/hongloumeng/95.html\">第九十五回 因讹成实元妃薨逝以假混真宝玉疯颠</a></li><li><a href=\"/book/hongloumeng/96.html\">第九十六回 瞒消息凤姐设奇谋 泄机关颦儿迷本性</a></li><li><a href=\"/book/hongloumeng/97.html\">第九十七回 林黛玉焚稿断痴情 薛宝钗出闺成大礼</a></li><li><a href=\"/book/hongloumeng/98.html\">第九十八回 苦绛珠魂归离恨天 病神瑛泪洒相思地</a></li><li><a href=\"/book/hongloumeng/99.html\">第九十九回 守官箴恶奴同破例 阅邸报老舅自担惊</a></li><li><a href=\"/book/hongloumeng/100.html\">第一百回 破好事香菱结深恨 悲远嫁宝玉感离情</a></li><li><a href=\"/book/hongloumeng/101.html\">第一百零一回 大观园月夜警幽魂 散花寺神签占异兆</a></li><li><a href=\"/book/hongloumeng/102.html\">第一百零二回 宁国府骨肉病灾祲 大观园符水驱妖孽</a></li><li><a href=\"/book/hongloumeng/103.html\">第一百零三回 施毒计金桂自焚身 昧真禅雨村空遇旧</a></li><li><a href=\"/book/hongloumeng/104.html\">第一百零四回 醉金刚小鳅生大浪 痴公子馀痛触前情</a></li><li><a href=\"/book/hongloumeng/105.html\">第一百零五回 锦衣军查抄宁国府 骢马使弹劾平安州</a></li><li><a href=\"/book/hongloumeng/106.html\">第一百零六回 王熙凤致祸抱羞惭 贾太君祷天消灾患</a></li><li><a href=\"/book/hongloumeng/107.html\">第一百零七回 散馀资贾母明大义 复世职政老沐天恩</a></li><li><a href=\"/book/hongloumeng/108.html\">第一百零八回 强欢笑蘅芜庆生辰 死缠绵闻鬼哭</a></li><li><a href=\"/book/hongloumeng/109.html\">第一百零九回 候芳魂五儿承错爱还孽债迎女返真元</a></li><li><a href=\"/book/hongloumeng/110.html\">第一百一十回 史太君寿终归地府 王凤姐力诎失人心</a></li><li><a href=\"/book/hongloumeng/111.html\">第一百一十一回 鸳鸯女殉主登太虚 狗彘奴欺天招伙盗</a></li><li><a href=\"/book/hongloumeng/112.html\">第一百一十二回 活冤孽妙姑遭大劫 死雠仇赵妾赴冥曹</a></li><li><a href=\"/book/hongloumeng/113.html\">第一百一十三回 忏宿冤凤姐托村妪 释旧憾情婢感痴郎</a></li><li><a href=\"/book/hongloumeng/114.html\">第一百一十四回 王熙凤历幻返金陵 甄应嘉蒙恩还玉阙</a></li><li><a href=\"/book/hongloumeng/115.html\">第一百一十五回 惑偏私惜春矢素志 证同类宝玉失相知</a></li><li><a href=\"/book/hongloumeng/116.html\">第一百一十六回 得通灵幻境悟仙缘 送慈柩故乡全孝道</a></li><li><a href=\"/book/hongloumeng/117.html\">第一百一十七回 阻超凡佳人双护玉 欣聚党恶子独承家</a></li><li><a href=\"/book/hongloumeng/118.html\">第一百一十八回 记微嫌舅兄欺弱女 警谜语妻妾谏痴人</a></li><li><a href=\"/book/hongloumeng/119.html\">第一百一十九回 中乡魁宝玉却尘缘 沐皇恩贾家延世泽</a></li><li><a href=\"/book/hongloumeng/120.html\">第一百二十回 甄士隐详说太虚情 贾雨村归结红楼梦</a></li>                </ul>\n",
      "            </div>\n",
      "        </div>\n",
      "    </div>\n",
      "    <div  id=\"main_right\">\n",
      "        \n",
      "        \t<div class=\"card right-book-card\">\n",
      "\t\t<div class=\"aside_title\">推荐阅读</div>\n",
      "\t\t\t<h6>四大名著</h6>\n",
      "\t\t\t<div>\n",
      "\t\t\t<ul>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/sanguoyanyi.html\">《三国演义》</a></li>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/shuihuzhuan.html\">《水浒传》</a></li>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/xiyouji.html\">《西游记》</a></li>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/hongloumeng.html\">《红楼梦》</a></li>\n",
      "\t\t\t\t\t\t\t\t<div style=\"clear: both\"></div>\n",
      "\t\t\t</ul>\n",
      "\t\t</div>\n",
      "\t\t\t\t<h6>二十四史</h6>\n",
      "\t\t\t<div>\n",
      "\t\t\t<ul>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/shiji.html\">《史记》</a></li>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/hanshu.html\">《汉书》</a></li>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/houhanshu.html\">《后汉书》</a></li>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/sanguozhi.html\">《三国志》</a></li>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/jinshu.html\">《晋书》</a></li>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/songshu.html\">《宋书》</a></li>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/nanqishu.html\">《南齐书》</a></li>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/liangshu.html\">《梁书》</a></li>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/chenshu.html\">《陈书》</a></li>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/weishu.html\">《魏书》</a></li>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/beiqishu.html\">《北齐书》</a></li>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/zhoushu.html\">《周书》</a></li>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/suishu.html\">《隋书》</a></li>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/nanshi.html\">《南史》</a></li>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/beishi.html\">《北史》</a></li>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/jiutangshu.html\">《旧唐书》</a></li>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/xintangshu.html\">《新唐书》</a></li>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/jiuwudaishi.html\">《旧五代史》</a></li>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/xinwudaishi.html\">《新五代史》</a></li>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/songshi.html\">《宋史》</a></li>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/liaoshi.html\">《辽史》</a></li>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/jinshi.html\">《金史》</a></li>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/yuanshi.html\">《元史》</a></li>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/mingshi.html\">《明史》</a></li>\n",
      "\t\t\t\t\t\t\t\t<div style=\"clear: both\"></div>\n",
      "\t\t\t</ul>\n",
      "\t\t</div>\n",
      "\t\t\t\t<h6>四书</h6>\n",
      "\t\t\t<div>\n",
      "\t\t\t<ul>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/lunyu.html\">《论语》</a></li>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/mengzi.html\">《孟子》</a></li>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/daxue.html\">《大学》</a></li>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/zhongyong.html\">《中庸》</a></li>\n",
      "\t\t\t\t\t\t\t\t<div style=\"clear: both\"></div>\n",
      "\t\t\t</ul>\n",
      "\t\t</div>\n",
      "\t\t\t\t<h6>五经</h6>\n",
      "\t\t\t<div>\n",
      "\t\t\t<ul>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/shangshu.html\">《尚书》</a></li>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/liji.html\">《礼记》</a></li>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/zhouyi.html\">《周易》</a></li>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/chunqiuzuozhuan.html\">《春秋左氏传》</a></li>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/shijing.html\">《诗经》</a></li>\n",
      "\t\t\t\t\t\t\t\t<div style=\"clear: both\"></div>\n",
      "\t\t\t</ul>\n",
      "\t\t</div>\n",
      "\t\t\t\t<h6>演义小说</h6>\n",
      "\t\t\t<div>\n",
      "\t\t\t<ul>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/sanguoyanyi.html\">《三国演义》</a></li>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/suitangyanyi.html\">《隋唐演义》</a></li>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/dongzhoulieguozhi.html\">《东周列国志》</a></li>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/yangjiajiang.html\">《杨家将》</a></li>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/qianhanyanyi.html\">《前汉演义》</a></li>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/houhanyanyi.html\">《后汉演义》</a></li>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/liangjinyanyi.html\">《两晋演义》</a></li>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/nanbeishiyanyi.html\">《南北史演义》</a></li>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/cantangwudaishiyanyi.html\">《残唐五代史演义》</a></li>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/suitangliangchaozhizhuan.html\">《隋唐两朝志传》</a></li>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/yuanshiyanyi.html\">《元史演义》</a></li>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/mingshiyanyi.html\">《明史演义》</a></li>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/qingshiyanyi.html\">《清史演义》</a></li>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/minguoyanyi.html\">《民国演义》</a></li>\n",
      "\t\t\t\t\t\t\t\t<div style=\"clear: both\"></div>\n",
      "\t\t\t</ul>\n",
      "\t\t</div>\n",
      "\t\t\t</div>\n",
      "\n",
      "        \n",
      "    </div>\n",
      "    <div style=\"clear: both;\"></div>\n",
      "</div><a href=\"javascript:toTop();\"><div id=\"toTop\">顶部</div></a>\n",
      "<div id=\"footer\">\n",
      "    <div id=\"footer_main\">\n",
      "        <div id=\"bottom_nav\">\n",
      "            <a href=\"/category/story\">诗人故事</a>\n",
      "            <a href=\"/category/xiehouyu\">歇后语</a>\n",
      "            <a href=\"/category/miyu\">谜语</a>\n",
      "            <a href=\"/category/duilian\">对联</a>\n",
      "                        Copyright © 2010-2020 <a href=\"https://beian.miit.gov.cn/#/Integrated/index\" target=\"_blank\">京ICP备2021022011号-1</a> \n",
      "                    </div>\n",
      "    </div>\n",
      "</div>\n",
      "\n",
      "<script>\n",
      "var _hmt = _hmt || [];\n",
      "(function() {\n",
      "  var hm = document.createElement(\"script\");\n",
      "  hm.src = \"https://hm.baidu.com/hm.js?649f268280b553df1f778477ee743752\";\n",
      "  var s = document.getElementsByTagName(\"script\")[0];\n",
      "  s.parentNode.insertBefore(hm, s);\n",
      "})();\n",
      "</script>\n",
      "\n",
      "</body>\n",
      "</html>\n"
     ]
    }
   ],
   "source": [
    "import requests\n",
    "from bs4 import BeautifulSoup\n",
    "\n",
    "url='https://www.shicimingju.com/book/hongloumeng.html'\n",
    "\n",
    "headers={'user-agent':'Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.74 Mobile Safari/537.36'}\n",
    "\n",
    "html=requests.get(url=url,headers=headers).content.decode('utf-8')\n",
    "\n",
    "print(html)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 57,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<!DOCTYPE html>\n",
      "<html lang=\"zh\">\n",
      " <head>\n",
      "  <script src=\"https://ip.ws.126.net/ipquery\" type=\"text/javascript\">\n",
      "  </script>\n",
      "  <script src=\"/newpage/js/all.js\">\n",
      "  </script>\n",
      "  <meta charset=\"utf-8\"/>\n",
      "  <title>\n",
      "   《红楼梦》全集在线阅读_史书典籍_诗词名句网\n",
      "  </title>\n",
      "  <meta content=\"width=device-width,user-scalable=no\" name=\"viewport\"/>\n",
      "  <meta content=\"\" name=\"description\"/>\n",
      "  <link href=\"/public/css/www_v3.css\" rel=\"stylesheet\"/>\n",
      "  <link href=\"/public/css/font_576092_m2icqcebp7evzpvi.css\" rel=\"stylesheet\"/>\n",
      "  <script src=\"/public/js/device.js\">\n",
      "  </script>\n",
      "  <script src=\"/public/js/jq.js\">\n",
      "  </script>\n",
      "  <script src=\"/public/js/www_v3.js\">\n",
      "  </script>\n",
      " </head>\n",
      " <body>\n",
      "  <div id=\"top_bar\">\n",
      "   <div id=\"top_bar_main\">\n",
      "    <div id=\"top_left\">\n",
      "     <a href=\"/\">\n",
      "      <img id=\"logo\" src=\"/public/image/logo.png\"/>\n",
      "     </a>\n",
      "     <div id=\"top_left_menu\">\n",
      "      <ul>\n",
      "       <li>\n",
      "        <a href=\"/\">\n",
      "         首页\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/shicimark\">\n",
      "         分类\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/category/all\">\n",
      "         作者\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/paiming\">\n",
      "         排行榜\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/cate?cate_id=4\">\n",
      "         课本古诗\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/cipai/index.html\">\n",
      "         词牌名\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/cangtoushi/index.html\">\n",
      "         藏头诗\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/hecheng/index.html\">\n",
      "         合称\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/\">\n",
      "         古籍\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/app/\">\n",
      "         安卓下载\n",
      "        </a>\n",
      "       </li>\n",
      "      </ul>\n",
      "     </div>\n",
      "     <div style=\"clear: both\">\n",
      "     </div>\n",
      "    </div>\n",
      "    <div id=\"top_right\">\n",
      "     <div id=\"top_right_nav\">\n",
      "      <ul>\n",
      "       <li>\n",
      "        <a data-cate=\"all\" href=\"javascript:void(0)\">\n",
      "         综合\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a data-cate=\"zuozhe\" href=\"javascript:void(0)\">\n",
      "         作者\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a data-cate=\"title\" href=\"javascript:void(0)\">\n",
      "         标题\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a data-cate=\"shiju\" href=\"javascript:void(0)\">\n",
      "         诗句\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a data-cate=\"first\" href=\"javascript:void(0)\">\n",
      "         句首\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a data-cate=\"end\" href=\"javascript:void(0)\">\n",
      "         句尾\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a data-cate=\"book\" href=\"javascript:void(0)\">\n",
      "         古籍\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a data-cate=\"chengyu\" href=\"javascript:void(0)\">\n",
      "         成语\n",
      "        </a>\n",
      "       </li>\n",
      "      </ul>\n",
      "     </div>\n",
      "     <div id=\"input_div\">\n",
      "      <input autocomplete=\"off\" id=\"search_input\" name=\"kw\" placeholder=\"\" type=\"text\" value=\"\"/>\n",
      "      <a href=\"javascript:doSearch();\">\n",
      "       <img class=\"www-icon\" src=\"/public/image/web_search.png\"/>\n",
      "      </a>\n",
      "      <div style=\"clear: both\">\n",
      "      </div>\n",
      "     </div>\n",
      "     <div class=\"card\" id=\"tip_result\">\n",
      "      <ul>\n",
      "      </ul>\n",
      "      <div id=\"tip_content\">\n",
      "      </div>\n",
      "     </div>\n",
      "    </div>\n",
      "    <div style=\"clear: both;\">\n",
      "    </div>\n",
      "   </div>\n",
      "  </div>\n",
      "  <div id=\"nav-top\">\n",
      "   <a href=\"/\">\n",
      "    主页\n",
      "   </a>\n",
      "   <span class=\"nav-arrow\">\n",
      "   </span>\n",
      "   <a href=\"/book/index.html\">\n",
      "    史书典籍\n",
      "   </a>\n",
      "   <span class=\"nav-arrow\">\n",
      "   </span>\n",
      "   <a href=\"/book/sidamingzhu.html\">\n",
      "    四大名著\n",
      "   </a>\n",
      "  </div>\n",
      "  <div id=\"main\">\n",
      "   <div id=\"main_left\">\n",
      "    <div class=\"card bookmark-list\">\n",
      "     <h1>\n",
      "      《红楼梦》\n",
      "     </h1>\n",
      "     <div>\n",
      "      <img class=\"book-img\" src=\"/public/image/book/hongloumeng.jpg\"/>\n",
      "      <p>\n",
      "       年代：清\n",
      "      </p>\n",
      "      <p>\n",
      "       作者：曹雪芹、高鹗\n",
      "      </p>\n",
      "      <p class=\"des\">\n",
      "       《红楼梦》，中国古典四大名著之首，清代作家曹雪芹创作的章回体长篇小说。早期仅有前八十回抄本流传，原名《石头记》。程伟元搜集到后四十回残稿，邀请高鹗协同整理出版百二十回全本，定名《红楼梦》。亦有版本作《金玉缘》《脂砚斋重评石头记》。\n",
      "       <br/>\n",
      "       《红楼梦》是一部具有世界影响力的伟大作品，举世公认的中国古典小说巅峰之作，中国封建社会的百科全书，传统文化的集大成者。小说以贾、王、史、薛四大家族的兴衰为背景，以贾府的家庭琐事、闺阁闲情为中心，以贾宝玉、林黛玉、薛宝钗的爱情婚姻故事为主线，描写了金陵十二钗的人性美和悲剧美，歌颂追求光明的叛逆人物，通过叛逆者的悲剧命运预见封建社会必然走向灭亡，揭示出封建末世危机。\n",
      "      </p>\n",
      "      <div style=\"clear: both\">\n",
      "      </div>\n",
      "     </div>\n",
      "     <div>\n",
      "      <form action=\"/book/chaxun/\" method=\"get\" style=\"float: right;\">\n",
      "       <input name=\"book_id\" type=\"hidden\" value=\"4\"/>\n",
      "       <input autocomplete=\"off\" name=\"kw\" placeholder=\"全文检索\" type=\"text\"/>\n",
      "      </form>\n",
      "      <div style=\"clear: both\">\n",
      "      </div>\n",
      "     </div>\n",
      "     <div class=\"line\">\n",
      "     </div>\n",
      "     <div class=\"book-mulu\">\n",
      "      <ul>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/1.html\">\n",
      "         第 一 回 甄士隐梦幻识通灵 贾雨村风尘怀闺秀\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/2.html\">\n",
      "         第 二 回 贾夫人仙逝扬州城 冷子兴演说荣国府\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/3.html\">\n",
      "         第 三 回 托内兄如海酬训教 接外孙贾母惜孤女\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/4.html\">\n",
      "         第 四 回 薄命女偏逢薄命郎 葫芦僧乱判葫芦案\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/5.html\">\n",
      "         第 五 回 游幻境指迷十二钗 饮仙醪曲演红楼梦\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/6.html\">\n",
      "         第 六 回 贾宝玉初试云雨情 刘姥姥一进荣国府\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/7.html\">\n",
      "         第 七 回 送宫花贾琏戏熙凤 宴宁府宝玉会秦钟\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/8.html\">\n",
      "         第 八 回 比通灵金莺微露意 探宝钗黛玉半含酸\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/9.html\">\n",
      "         第 九 回 恋风流情友入家塾 起嫌疑顽童闹学堂\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/10.html\">\n",
      "         第 十 回 金寡妇贪利权受辱 张太医论病细穷源\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/11.html\">\n",
      "         第十一回 庆寿辰宁府排家宴 见熙凤贾瑞起淫心\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/12.html\">\n",
      "         第十二回 王熙凤毒设相思局 贾天祥正照\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/13.html\">\n",
      "         第十三回 秦可卿死封龙禁尉 王熙凤协理宁国府\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/14.html\">\n",
      "         第十四回 林如海捐馆扬州城 贾宝玉路谒北静王\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/15.html\">\n",
      "         第十五回 王凤姐弄权铁槛寺 秦鲸卿得趣馒头庵\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/16.html\">\n",
      "         第十六回 贾元春才选凤藻宫 秦鲸卿夭逝黄泉路\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/17.html\">\n",
      "         第十七回 大观园试才题对额 荣国府归省庆元宵\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/18.html\">\n",
      "         第十八回 隔珠帘父女勉忠勤 搦湘管姊弟裁题咏\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/19.html\">\n",
      "         第十九回 情切切良宵花解语 意绵绵静日玉生香\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/20.html\">\n",
      "         第二十回 王熙凤正言弹妒意 林黛玉俏语谑娇音\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/21.html\">\n",
      "         第二十一回 贤袭人娇嗔箴宝玉 俏平儿软语救贾琏\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/22.html\">\n",
      "         第二十二回 听曲文宝玉悟禅机 制灯谜贾政悲谶语\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/23.html\">\n",
      "         第二十三回 西厢记妙词通戏语 牡丹亭艳曲警芳心\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/24.html\">\n",
      "         第二十四回 醉金刚轻财尚义侠 痴女儿遗帕惹相思\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/25.html\">\n",
      "         第二十五回 魇魔法叔嫂逢五鬼 红楼梦通灵遇双真\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/26.html\">\n",
      "         第二十六回 蜂腰桥设言传密意 馆春困发幽情\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/27.html\">\n",
      "         第二十七回 滴翠亭杨妃戏彩蝶 埋香冢飞燕泣残红\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/28.html\">\n",
      "         第二十八回 蒋玉菡情赠茜香罗 薛宝钗羞笼红麝串\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/29.html\">\n",
      "         第二十九回 享福人福深还祷福 痴情女情重愈斟情\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/30.html\">\n",
      "         第三十回 宝钗借扇机带双敲 龄官划蔷痴及局外\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/31.html\">\n",
      "         第三十一回 撕扇子作千金一笑 因麒麟伏白首双星\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/32.html\">\n",
      "         第三十二回 诉肺腑心迷活宝玉 含耻辱情烈死金钏\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/33.html\">\n",
      "         第三十三回 手足眈眈小动唇舌 不肖种种大承笞挞\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/34.html\">\n",
      "         第三十四回 情中情因情感妹妹 错里错以错劝哥哥\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/35.html\">\n",
      "         第三十五回 白玉钏亲尝莲叶羹 黄金莺巧结梅花络\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/36.html\">\n",
      "         第三十六回 绣鸳鸯梦兆绛芸轩 识分定情悟梨香院\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/37.html\">\n",
      "         第三十七回 秋爽斋偶结海棠社 蘅芜苑夜拟菊花题\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/38.html\">\n",
      "         第三十八回 林魁夺菊花诗 薛蘅芜讽和螃蟹咏\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/39.html\">\n",
      "         第三十九回 村姥姥是信口开河 情哥哥偏寻根究底\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/40.html\">\n",
      "         第四十回 史太君两宴大观园 金鸳鸯三宣牙牌令\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/41.html\">\n",
      "         第四十一回 贾宝玉品茶栊翠庵 刘姥姥醉卧怡红院\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/42.html\">\n",
      "         第四十二回 蘅芜君兰言解疑癖 子雅谑补馀香\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/43.html\">\n",
      "         第四十三回 闲取乐偶攒金庆寿 不了情暂撮土为香\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/44.html\">\n",
      "         第四十四回 变生不测凤姐泼醋 喜出望外平儿理妆\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/45.html\">\n",
      "         第四十五回 金兰契互剖金兰语 风雨夕闷制风雨词\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/46.html\">\n",
      "         第四十六回 尴尬人难免尴尬事 鸳鸯女誓绝鸳鸯偶\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/47.html\">\n",
      "         第四十七回 呆霸王调情遭苦打 冷郎君惧祸走他乡\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/48.html\">\n",
      "         第四十八回 滥情人情误思游艺 慕雅女雅集苦吟诗\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/49.html\">\n",
      "         第四十九回 琉璃世界白雪红梅 脂粉香娃割腥啖膻\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/50.html\">\n",
      "         第五十回 芦雪庵争联即景诗 暖香坞雅制春灯谜\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/51.html\">\n",
      "         第五十一回 薛小妹新编怀古诗 胡庸医乱用虎狼药\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/52.html\">\n",
      "         第五十二回 俏平儿情掩虾须镯 勇晴雯病补雀金裘\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/53.html\">\n",
      "         第五十三回 宁国府除夕祭宗祠 荣国府元宵开夜宴\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/54.html\">\n",
      "         第五十四回 史太君破陈腐旧套 王熙凤效戏彩斑衣\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/55.html\">\n",
      "         第五十五回 辱亲女愚妾争闲气 欺幼主刁奴蓄险心\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/56.html\">\n",
      "         第五十六回 敏探春兴利除宿弊 识宝钗小惠全大体\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/57.html\">\n",
      "         第五十七回 慧紫鹃情辞试忙玉 慈姨妈爱语慰痴颦\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/58.html\">\n",
      "         第五十八回 杏子阴假凤泣虚凰 茜纱窗真情揆痴理\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/59.html\">\n",
      "         第五十九回 柳叶渚边嗔莺咤燕 绛芸轩里召将飞符\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/60.html\">\n",
      "         第六十回 茉莉粉替去蔷薇硝 玫瑰露引来茯苓霜\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/61.html\">\n",
      "         第六十一回 投鼠忌器宝玉瞒赃 判冤决狱平儿行权\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/62.html\">\n",
      "         第六十二回 憨湘云醉眠芍药裀 呆香菱情解石榴裙\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/63.html\">\n",
      "         第六十三回 寿怡红群芳开夜宴 死金丹独艳理亲丧\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/64.html\">\n",
      "         第六十四回 幽淑女悲题五美吟 浪荡子情遗九龙佩\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/65.html\">\n",
      "         第六十五回 贾二舍偷娶尤二姨 尤三姐思嫁柳二郎\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/66.html\">\n",
      "         第六十六回 情小妹耻情归地府 冷二郎一冷入空门\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/67.html\">\n",
      "         第六十七回 见土仪颦卿思故里 闻秘事凤姐讯家童\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/68.html\">\n",
      "         第六十八回 苦尤娘赚入大观园 酸凤姐大闹宁国府\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/69.html\">\n",
      "         第六十九回 弄小巧用借剑杀人 觉大限吞生金自逝\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/70.html\">\n",
      "         第七十回 林黛玉重建桃花社 史湘云偶填柳絮词\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/71.html\">\n",
      "         第七十一回 嫌隙人有心生嫌隙 鸳鸯女无意遇鸳鸯\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/72.html\">\n",
      "         第七十二回 王熙凤恃强羞说病 来旺妇倚势霸成亲\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/73.html\">\n",
      "         第七十三回 痴丫头误拾绣春囊 懦小姐不问累金凤\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/74.html\">\n",
      "         第七十四回 惑奸谗抄检大观园 矢孤介杜绝宁国府\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/75.html\">\n",
      "         第七十五回 开夜宴异兆发悲音 赏中秋新词得佳谶\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/76.html\">\n",
      "         第七十六回 凸碧堂品笛感凄清 凹晶馆联诗悲寂寞\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/77.html\">\n",
      "         第七十七回 俏丫鬟抱屈夭风流 美优伶斩情归水月\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/78.html\">\n",
      "         第七十八回 老学士闲徵姽嫿词 痴公子杜撰芙蓉诔\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/79.html\">\n",
      "         第七十九回 薛文龙悔娶河东狮 贾迎春误嫁中山狼\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/80.html\">\n",
      "         第八十回 美香菱屈受贪夫棒 王道士胡诌妒妇方\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/81.html\">\n",
      "         第八十一回 占旺相四美钓游鱼 奉严词两番入家塾\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/82.html\">\n",
      "         第八十二回 老学究讲义警顽心病痴魂惊恶梦\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/83.html\">\n",
      "         第八十三回 省宫闱贾元妃染恙 闹闺阃薛宝钗吞声\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/84.html\">\n",
      "         第八十四回 试文字宝玉始提亲 探惊风贾环重结怨\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/85.html\">\n",
      "         第八十五回 贾存周报升郎中任 薛文起复惹放流刑\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/86.html\">\n",
      "         第八十六回 受私贿老官翻案牍 寄闲情淑女解琴书\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/87.html\">\n",
      "         第八十七回 感秋声抚琴悲往事 坐禅寂走火入邪魔\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/88.html\">\n",
      "         第八十八回 博庭欢宝玉赞孤儿 正家法贾珍鞭悍仆\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/89.html\">\n",
      "         第八十九回 人亡物在公子填词 蛇影杯弓颦卿绝粒\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/90.html\">\n",
      "         第九十回 失绵衣贫女耐嗷嘈 送果品小郎惊叵测\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/91.html\">\n",
      "         第九十一回 纵淫心宝蟾工设计 布疑阵宝玉妄谈禅\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/92.html\">\n",
      "         第九十二回 评女传巧姐慕贤良 顽母珠贾政参聚散\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/93.html\">\n",
      "         第九十三回 甄家仆投靠贾家门 水月庵掀翻风月案\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/94.html\">\n",
      "         第九十四回 宴海棠贾母赏花妖 失宝玉通灵知奇祸\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/95.html\">\n",
      "         第九十五回 因讹成实元妃薨逝以假混真宝玉疯颠\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/96.html\">\n",
      "         第九十六回 瞒消息凤姐设奇谋 泄机关颦儿迷本性\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/97.html\">\n",
      "         第九十七回 林黛玉焚稿断痴情 薛宝钗出闺成大礼\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/98.html\">\n",
      "         第九十八回 苦绛珠魂归离恨天 病神瑛泪洒相思地\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/99.html\">\n",
      "         第九十九回 守官箴恶奴同破例 阅邸报老舅自担惊\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/100.html\">\n",
      "         第一百回 破好事香菱结深恨 悲远嫁宝玉感离情\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/101.html\">\n",
      "         第一百零一回 大观园月夜警幽魂 散花寺神签占异兆\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/102.html\">\n",
      "         第一百零二回 宁国府骨肉病灾祲 大观园符水驱妖孽\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/103.html\">\n",
      "         第一百零三回 施毒计金桂自焚身 昧真禅雨村空遇旧\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/104.html\">\n",
      "         第一百零四回 醉金刚小鳅生大浪 痴公子馀痛触前情\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/105.html\">\n",
      "         第一百零五回 锦衣军查抄宁国府 骢马使弹劾平安州\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/106.html\">\n",
      "         第一百零六回 王熙凤致祸抱羞惭 贾太君祷天消灾患\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/107.html\">\n",
      "         第一百零七回 散馀资贾母明大义 复世职政老沐天恩\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/108.html\">\n",
      "         第一百零八回 强欢笑蘅芜庆生辰 死缠绵闻鬼哭\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/109.html\">\n",
      "         第一百零九回 候芳魂五儿承错爱还孽债迎女返真元\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/110.html\">\n",
      "         第一百一十回 史太君寿终归地府 王凤姐力诎失人心\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/111.html\">\n",
      "         第一百一十一回 鸳鸯女殉主登太虚 狗彘奴欺天招伙盗\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/112.html\">\n",
      "         第一百一十二回 活冤孽妙姑遭大劫 死雠仇赵妾赴冥曹\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/113.html\">\n",
      "         第一百一十三回 忏宿冤凤姐托村妪 释旧憾情婢感痴郎\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/114.html\">\n",
      "         第一百一十四回 王熙凤历幻返金陵 甄应嘉蒙恩还玉阙\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/115.html\">\n",
      "         第一百一十五回 惑偏私惜春矢素志 证同类宝玉失相知\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/116.html\">\n",
      "         第一百一十六回 得通灵幻境悟仙缘 送慈柩故乡全孝道\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/117.html\">\n",
      "         第一百一十七回 阻超凡佳人双护玉 欣聚党恶子独承家\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/118.html\">\n",
      "         第一百一十八回 记微嫌舅兄欺弱女 警谜语妻妾谏痴人\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/119.html\">\n",
      "         第一百一十九回 中乡魁宝玉却尘缘 沐皇恩贾家延世泽\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng/120.html\">\n",
      "         第一百二十回 甄士隐详说太虚情 贾雨村归结红楼梦\n",
      "        </a>\n",
      "       </li>\n",
      "      </ul>\n",
      "     </div>\n",
      "    </div>\n",
      "   </div>\n",
      "   <div id=\"main_right\">\n",
      "    <div class=\"card right-book-card\">\n",
      "     <div class=\"aside_title\">\n",
      "      推荐阅读\n",
      "     </div>\n",
      "     <h6>\n",
      "      四大名著\n",
      "     </h6>\n",
      "     <div>\n",
      "      <ul>\n",
      "       <li>\n",
      "        <a href=\"/book/sanguoyanyi.html\">\n",
      "         《三国演义》\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/shuihuzhuan.html\">\n",
      "         《水浒传》\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/xiyouji.html\">\n",
      "         《西游记》\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng.html\">\n",
      "         《红楼梦》\n",
      "        </a>\n",
      "       </li>\n",
      "       <div style=\"clear: both\">\n",
      "       </div>\n",
      "      </ul>\n",
      "     </div>\n",
      "     <h6>\n",
      "      二十四史\n",
      "     </h6>\n",
      "     <div>\n",
      "      <ul>\n",
      "       <li>\n",
      "        <a href=\"/book/shiji.html\">\n",
      "         《史记》\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hanshu.html\">\n",
      "         《汉书》\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/houhanshu.html\">\n",
      "         《后汉书》\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/sanguozhi.html\">\n",
      "         《三国志》\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/jinshu.html\">\n",
      "         《晋书》\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/songshu.html\">\n",
      "         《宋书》\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/nanqishu.html\">\n",
      "         《南齐书》\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/liangshu.html\">\n",
      "         《梁书》\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/chenshu.html\">\n",
      "         《陈书》\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/weishu.html\">\n",
      "         《魏书》\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/beiqishu.html\">\n",
      "         《北齐书》\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/zhoushu.html\">\n",
      "         《周书》\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/suishu.html\">\n",
      "         《隋书》\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/nanshi.html\">\n",
      "         《南史》\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/beishi.html\">\n",
      "         《北史》\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/jiutangshu.html\">\n",
      "         《旧唐书》\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/xintangshu.html\">\n",
      "         《新唐书》\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/jiuwudaishi.html\">\n",
      "         《旧五代史》\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/xinwudaishi.html\">\n",
      "         《新五代史》\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/songshi.html\">\n",
      "         《宋史》\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/liaoshi.html\">\n",
      "         《辽史》\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/jinshi.html\">\n",
      "         《金史》\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/yuanshi.html\">\n",
      "         《元史》\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/mingshi.html\">\n",
      "         《明史》\n",
      "        </a>\n",
      "       </li>\n",
      "       <div style=\"clear: both\">\n",
      "       </div>\n",
      "      </ul>\n",
      "     </div>\n",
      "     <h6>\n",
      "      四书\n",
      "     </h6>\n",
      "     <div>\n",
      "      <ul>\n",
      "       <li>\n",
      "        <a href=\"/book/lunyu.html\">\n",
      "         《论语》\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/mengzi.html\">\n",
      "         《孟子》\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/daxue.html\">\n",
      "         《大学》\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/zhongyong.html\">\n",
      "         《中庸》\n",
      "        </a>\n",
      "       </li>\n",
      "       <div style=\"clear: both\">\n",
      "       </div>\n",
      "      </ul>\n",
      "     </div>\n",
      "     <h6>\n",
      "      五经\n",
      "     </h6>\n",
      "     <div>\n",
      "      <ul>\n",
      "       <li>\n",
      "        <a href=\"/book/shangshu.html\">\n",
      "         《尚书》\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/liji.html\">\n",
      "         《礼记》\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/zhouyi.html\">\n",
      "         《周易》\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/chunqiuzuozhuan.html\">\n",
      "         《春秋左氏传》\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/shijing.html\">\n",
      "         《诗经》\n",
      "        </a>\n",
      "       </li>\n",
      "       <div style=\"clear: both\">\n",
      "       </div>\n",
      "      </ul>\n",
      "     </div>\n",
      "     <h6>\n",
      "      演义小说\n",
      "     </h6>\n",
      "     <div>\n",
      "      <ul>\n",
      "       <li>\n",
      "        <a href=\"/book/sanguoyanyi.html\">\n",
      "         《三国演义》\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/suitangyanyi.html\">\n",
      "         《隋唐演义》\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/dongzhoulieguozhi.html\">\n",
      "         《东周列国志》\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/yangjiajiang.html\">\n",
      "         《杨家将》\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/qianhanyanyi.html\">\n",
      "         《前汉演义》\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/houhanyanyi.html\">\n",
      "         《后汉演义》\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/liangjinyanyi.html\">\n",
      "         《两晋演义》\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/nanbeishiyanyi.html\">\n",
      "         《南北史演义》\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/cantangwudaishiyanyi.html\">\n",
      "         《残唐五代史演义》\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/suitangliangchaozhizhuan.html\">\n",
      "         《隋唐两朝志传》\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/yuanshiyanyi.html\">\n",
      "         《元史演义》\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/mingshiyanyi.html\">\n",
      "         《明史演义》\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/qingshiyanyi.html\">\n",
      "         《清史演义》\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/minguoyanyi.html\">\n",
      "         《民国演义》\n",
      "        </a>\n",
      "       </li>\n",
      "       <div style=\"clear: both\">\n",
      "       </div>\n",
      "      </ul>\n",
      "     </div>\n",
      "    </div>\n",
      "   </div>\n",
      "   <div style=\"clear: both;\">\n",
      "   </div>\n",
      "  </div>\n",
      "  <a href=\"javascript:toTop();\">\n",
      "   <div id=\"toTop\">\n",
      "    顶部\n",
      "   </div>\n",
      "  </a>\n",
      "  <div id=\"footer\">\n",
      "   <div id=\"footer_main\">\n",
      "    <div id=\"bottom_nav\">\n",
      "     <a href=\"/category/story\">\n",
      "      诗人故事\n",
      "     </a>\n",
      "     <a href=\"/category/xiehouyu\">\n",
      "      歇后语\n",
      "     </a>\n",
      "     <a href=\"/category/miyu\">\n",
      "      谜语\n",
      "     </a>\n",
      "     <a href=\"/category/duilian\">\n",
      "      对联\n",
      "     </a>\n",
      "     Copyright © 2010-2020\n",
      "     <a href=\"https://beian.miit.gov.cn/#/Integrated/index\" target=\"_blank\">\n",
      "      京ICP备2021022011号-1\n",
      "     </a>\n",
      "    </div>\n",
      "   </div>\n",
      "  </div>\n",
      "  <script>\n",
      "   var _hmt = _hmt || [];\n",
      "(function() {\n",
      "  var hm = document.createElement(\"script\");\n",
      "  hm.src = \"https://hm.baidu.com/hm.js?649f268280b553df1f778477ee743752\";\n",
      "  var s = document.getElementsByTagName(\"script\")[0];\n",
      "  s.parentNode.insertBefore(hm, s);\n",
      "})();\n",
      "  </script>\n",
      " </body>\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "</html>\n"
     ]
    }
   ],
   "source": [
    "from bs4 import BeautifulSoup\n",
    "\n",
    "soup = BeautifulSoup(html, 'lxml')\n",
    "\n",
    "print(soup.prettify()) "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 58,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[<div class=\"book-mulu\">\n",
      "<ul>\n",
      "<li><a href=\"/book/hongloumeng/1.html\">第 一 回 甄士隐梦幻识通灵 贾雨村风尘怀闺秀</a></li><li><a href=\"/book/hongloumeng/2.html\">第 二 回 贾夫人仙逝扬州城 冷子兴演说荣国府</a></li><li><a href=\"/book/hongloumeng/3.html\">第 三 回 托内兄如海酬训教 接外孙贾母惜孤女</a></li><li><a href=\"/book/hongloumeng/4.html\">第 四 回 薄命女偏逢薄命郎 葫芦僧乱判葫芦案</a></li><li><a href=\"/book/hongloumeng/5.html\">第 五 回 游幻境指迷十二钗 饮仙醪曲演红楼梦</a></li><li><a href=\"/book/hongloumeng/6.html\">第 六 回 贾宝玉初试云雨情 刘姥姥一进荣国府</a></li><li><a href=\"/book/hongloumeng/7.html\">第 七 回 送宫花贾琏戏熙凤 宴宁府宝玉会秦钟</a></li><li><a href=\"/book/hongloumeng/8.html\">第 八 回 比通灵金莺微露意 探宝钗黛玉半含酸</a></li><li><a href=\"/book/hongloumeng/9.html\">第 九 回 恋风流情友入家塾 起嫌疑顽童闹学堂</a></li><li><a href=\"/book/hongloumeng/10.html\">第 十 回 金寡妇贪利权受辱 张太医论病细穷源</a></li><li><a href=\"/book/hongloumeng/11.html\">第十一回 庆寿辰宁府排家宴 见熙凤贾瑞起淫心</a></li><li><a href=\"/book/hongloumeng/12.html\">第十二回 王熙凤毒设相思局 贾天祥正照</a></li><li><a href=\"/book/hongloumeng/13.html\">第十三回 秦可卿死封龙禁尉 王熙凤协理宁国府</a></li><li><a href=\"/book/hongloumeng/14.html\">第十四回 林如海捐馆扬州城 贾宝玉路谒北静王</a></li><li><a href=\"/book/hongloumeng/15.html\">第十五回 王凤姐弄权铁槛寺 秦鲸卿得趣馒头庵</a></li><li><a href=\"/book/hongloumeng/16.html\">第十六回 贾元春才选凤藻宫 秦鲸卿夭逝黄泉路</a></li><li><a href=\"/book/hongloumeng/17.html\">第十七回 大观园试才题对额 荣国府归省庆元宵</a></li><li><a href=\"/book/hongloumeng/18.html\">第十八回 隔珠帘父女勉忠勤 搦湘管姊弟裁题咏</a></li><li><a href=\"/book/hongloumeng/19.html\">第十九回 情切切良宵花解语 意绵绵静日玉生香</a></li><li><a href=\"/book/hongloumeng/20.html\">第二十回 王熙凤正言弹妒意 林黛玉俏语谑娇音</a></li><li><a href=\"/book/hongloumeng/21.html\">第二十一回 贤袭人娇嗔箴宝玉 俏平儿软语救贾琏</a></li><li><a href=\"/book/hongloumeng/22.html\">第二十二回 听曲文宝玉悟禅机 制灯谜贾政悲谶语</a></li><li><a href=\"/book/hongloumeng/23.html\">第二十三回 西厢记妙词通戏语 牡丹亭艳曲警芳心</a></li><li><a href=\"/book/hongloumeng/24.html\">第二十四回 醉金刚轻财尚义侠 痴女儿遗帕惹相思</a></li><li><a href=\"/book/hongloumeng/25.html\">第二十五回 魇魔法叔嫂逢五鬼 红楼梦通灵遇双真</a></li><li><a href=\"/book/hongloumeng/26.html\">第二十六回 蜂腰桥设言传密意 馆春困发幽情</a></li><li><a href=\"/book/hongloumeng/27.html\">第二十七回 滴翠亭杨妃戏彩蝶 埋香冢飞燕泣残红</a></li><li><a href=\"/book/hongloumeng/28.html\">第二十八回 蒋玉菡情赠茜香罗 薛宝钗羞笼红麝串</a></li><li><a href=\"/book/hongloumeng/29.html\">第二十九回 享福人福深还祷福 痴情女情重愈斟情</a></li><li><a href=\"/book/hongloumeng/30.html\">第三十回 宝钗借扇机带双敲 龄官划蔷痴及局外</a></li><li><a href=\"/book/hongloumeng/31.html\">第三十一回 撕扇子作千金一笑 因麒麟伏白首双星</a></li><li><a href=\"/book/hongloumeng/32.html\">第三十二回 诉肺腑心迷活宝玉 含耻辱情烈死金钏</a></li><li><a href=\"/book/hongloumeng/33.html\">第三十三回 手足眈眈小动唇舌 不肖种种大承笞挞</a></li><li><a href=\"/book/hongloumeng/34.html\">第三十四回 情中情因情感妹妹 错里错以错劝哥哥</a></li><li><a href=\"/book/hongloumeng/35.html\">第三十五回 白玉钏亲尝莲叶羹 黄金莺巧结梅花络</a></li><li><a href=\"/book/hongloumeng/36.html\">第三十六回 绣鸳鸯梦兆绛芸轩 识分定情悟梨香院</a></li><li><a href=\"/book/hongloumeng/37.html\">第三十七回 秋爽斋偶结海棠社 蘅芜苑夜拟菊花题</a></li><li><a href=\"/book/hongloumeng/38.html\">第三十八回 林魁夺菊花诗 薛蘅芜讽和螃蟹咏</a></li><li><a href=\"/book/hongloumeng/39.html\">第三十九回 村姥姥是信口开河 情哥哥偏寻根究底</a></li><li><a href=\"/book/hongloumeng/40.html\">第四十回 史太君两宴大观园 金鸳鸯三宣牙牌令</a></li><li><a href=\"/book/hongloumeng/41.html\">第四十一回 贾宝玉品茶栊翠庵 刘姥姥醉卧怡红院</a></li><li><a href=\"/book/hongloumeng/42.html\">第四十二回 蘅芜君兰言解疑癖 子雅谑补馀香</a></li><li><a href=\"/book/hongloumeng/43.html\">第四十三回 闲取乐偶攒金庆寿 不了情暂撮土为香</a></li><li><a href=\"/book/hongloumeng/44.html\">第四十四回 变生不测凤姐泼醋 喜出望外平儿理妆</a></li><li><a href=\"/book/hongloumeng/45.html\">第四十五回 金兰契互剖金兰语 风雨夕闷制风雨词</a></li><li><a href=\"/book/hongloumeng/46.html\">第四十六回 尴尬人难免尴尬事 鸳鸯女誓绝鸳鸯偶</a></li><li><a href=\"/book/hongloumeng/47.html\">第四十七回 呆霸王调情遭苦打 冷郎君惧祸走他乡</a></li><li><a href=\"/book/hongloumeng/48.html\">第四十八回 滥情人情误思游艺 慕雅女雅集苦吟诗</a></li><li><a href=\"/book/hongloumeng/49.html\">第四十九回 琉璃世界白雪红梅 脂粉香娃割腥啖膻</a></li><li><a href=\"/book/hongloumeng/50.html\">第五十回 芦雪庵争联即景诗 暖香坞雅制春灯谜</a></li><li><a href=\"/book/hongloumeng/51.html\">第五十一回 薛小妹新编怀古诗 胡庸医乱用虎狼药</a></li><li><a href=\"/book/hongloumeng/52.html\">第五十二回 俏平儿情掩虾须镯 勇晴雯病补雀金裘</a></li><li><a href=\"/book/hongloumeng/53.html\">第五十三回 宁国府除夕祭宗祠 荣国府元宵开夜宴</a></li><li><a href=\"/book/hongloumeng/54.html\">第五十四回 史太君破陈腐旧套 王熙凤效戏彩斑衣</a></li><li><a href=\"/book/hongloumeng/55.html\">第五十五回 辱亲女愚妾争闲气 欺幼主刁奴蓄险心</a></li><li><a href=\"/book/hongloumeng/56.html\">第五十六回 敏探春兴利除宿弊 识宝钗小惠全大体</a></li><li><a href=\"/book/hongloumeng/57.html\">第五十七回 慧紫鹃情辞试忙玉 慈姨妈爱语慰痴颦</a></li><li><a href=\"/book/hongloumeng/58.html\">第五十八回 杏子阴假凤泣虚凰 茜纱窗真情揆痴理</a></li><li><a href=\"/book/hongloumeng/59.html\">第五十九回 柳叶渚边嗔莺咤燕 绛芸轩里召将飞符</a></li><li><a href=\"/book/hongloumeng/60.html\">第六十回 茉莉粉替去蔷薇硝 玫瑰露引来茯苓霜</a></li><li><a href=\"/book/hongloumeng/61.html\">第六十一回 投鼠忌器宝玉瞒赃 判冤决狱平儿行权</a></li><li><a href=\"/book/hongloumeng/62.html\">第六十二回 憨湘云醉眠芍药裀 呆香菱情解石榴裙</a></li><li><a href=\"/book/hongloumeng/63.html\">第六十三回 寿怡红群芳开夜宴 死金丹独艳理亲丧</a></li><li><a href=\"/book/hongloumeng/64.html\">第六十四回 幽淑女悲题五美吟 浪荡子情遗九龙佩</a></li><li><a href=\"/book/hongloumeng/65.html\">第六十五回 贾二舍偷娶尤二姨 尤三姐思嫁柳二郎</a></li><li><a href=\"/book/hongloumeng/66.html\">第六十六回 情小妹耻情归地府 冷二郎一冷入空门</a></li><li><a href=\"/book/hongloumeng/67.html\">第六十七回 见土仪颦卿思故里 闻秘事凤姐讯家童</a></li><li><a href=\"/book/hongloumeng/68.html\">第六十八回 苦尤娘赚入大观园 酸凤姐大闹宁国府</a></li><li><a href=\"/book/hongloumeng/69.html\">第六十九回 弄小巧用借剑杀人 觉大限吞生金自逝</a></li><li><a href=\"/book/hongloumeng/70.html\">第七十回 林黛玉重建桃花社 史湘云偶填柳絮词</a></li><li><a href=\"/book/hongloumeng/71.html\">第七十一回 嫌隙人有心生嫌隙 鸳鸯女无意遇鸳鸯</a></li><li><a href=\"/book/hongloumeng/72.html\">第七十二回 王熙凤恃强羞说病 来旺妇倚势霸成亲</a></li><li><a href=\"/book/hongloumeng/73.html\">第七十三回 痴丫头误拾绣春囊 懦小姐不问累金凤</a></li><li><a href=\"/book/hongloumeng/74.html\">第七十四回 惑奸谗抄检大观园 矢孤介杜绝宁国府</a></li><li><a href=\"/book/hongloumeng/75.html\">第七十五回 开夜宴异兆发悲音 赏中秋新词得佳谶</a></li><li><a href=\"/book/hongloumeng/76.html\">第七十六回 凸碧堂品笛感凄清 凹晶馆联诗悲寂寞</a></li><li><a href=\"/book/hongloumeng/77.html\">第七十七回 俏丫鬟抱屈夭风流 美优伶斩情归水月</a></li><li><a href=\"/book/hongloumeng/78.html\">第七十八回 老学士闲徵姽嫿词 痴公子杜撰芙蓉诔</a></li><li><a href=\"/book/hongloumeng/79.html\">第七十九回 薛文龙悔娶河东狮 贾迎春误嫁中山狼</a></li><li><a href=\"/book/hongloumeng/80.html\">第八十回 美香菱屈受贪夫棒 王道士胡诌妒妇方</a></li><li><a href=\"/book/hongloumeng/81.html\">第八十一回 占旺相四美钓游鱼 奉严词两番入家塾</a></li><li><a href=\"/book/hongloumeng/82.html\">第八十二回 老学究讲义警顽心病痴魂惊恶梦</a></li><li><a href=\"/book/hongloumeng/83.html\">第八十三回 省宫闱贾元妃染恙 闹闺阃薛宝钗吞声</a></li><li><a href=\"/book/hongloumeng/84.html\">第八十四回 试文字宝玉始提亲 探惊风贾环重结怨</a></li><li><a href=\"/book/hongloumeng/85.html\">第八十五回 贾存周报升郎中任 薛文起复惹放流刑</a></li><li><a href=\"/book/hongloumeng/86.html\">第八十六回 受私贿老官翻案牍 寄闲情淑女解琴书</a></li><li><a href=\"/book/hongloumeng/87.html\">第八十七回 感秋声抚琴悲往事 坐禅寂走火入邪魔</a></li><li><a href=\"/book/hongloumeng/88.html\">第八十八回 博庭欢宝玉赞孤儿 正家法贾珍鞭悍仆</a></li><li><a href=\"/book/hongloumeng/89.html\">第八十九回 人亡物在公子填词 蛇影杯弓颦卿绝粒</a></li><li><a href=\"/book/hongloumeng/90.html\">第九十回 失绵衣贫女耐嗷嘈 送果品小郎惊叵测</a></li><li><a href=\"/book/hongloumeng/91.html\">第九十一回 纵淫心宝蟾工设计 布疑阵宝玉妄谈禅</a></li><li><a href=\"/book/hongloumeng/92.html\">第九十二回 评女传巧姐慕贤良 顽母珠贾政参聚散</a></li><li><a href=\"/book/hongloumeng/93.html\">第九十三回 甄家仆投靠贾家门 水月庵掀翻风月案</a></li><li><a href=\"/book/hongloumeng/94.html\">第九十四回 宴海棠贾母赏花妖 失宝玉通灵知奇祸</a></li><li><a href=\"/book/hongloumeng/95.html\">第九十五回 因讹成实元妃薨逝以假混真宝玉疯颠</a></li><li><a href=\"/book/hongloumeng/96.html\">第九十六回 瞒消息凤姐设奇谋 泄机关颦儿迷本性</a></li><li><a href=\"/book/hongloumeng/97.html\">第九十七回 林黛玉焚稿断痴情 薛宝钗出闺成大礼</a></li><li><a href=\"/book/hongloumeng/98.html\">第九十八回 苦绛珠魂归离恨天 病神瑛泪洒相思地</a></li><li><a href=\"/book/hongloumeng/99.html\">第九十九回 守官箴恶奴同破例 阅邸报老舅自担惊</a></li><li><a href=\"/book/hongloumeng/100.html\">第一百回 破好事香菱结深恨 悲远嫁宝玉感离情</a></li><li><a href=\"/book/hongloumeng/101.html\">第一百零一回 大观园月夜警幽魂 散花寺神签占异兆</a></li><li><a href=\"/book/hongloumeng/102.html\">第一百零二回 宁国府骨肉病灾祲 大观园符水驱妖孽</a></li><li><a href=\"/book/hongloumeng/103.html\">第一百零三回 施毒计金桂自焚身 昧真禅雨村空遇旧</a></li><li><a href=\"/book/hongloumeng/104.html\">第一百零四回 醉金刚小鳅生大浪 痴公子馀痛触前情</a></li><li><a href=\"/book/hongloumeng/105.html\">第一百零五回 锦衣军查抄宁国府 骢马使弹劾平安州</a></li><li><a href=\"/book/hongloumeng/106.html\">第一百零六回 王熙凤致祸抱羞惭 贾太君祷天消灾患</a></li><li><a href=\"/book/hongloumeng/107.html\">第一百零七回 散馀资贾母明大义 复世职政老沐天恩</a></li><li><a href=\"/book/hongloumeng/108.html\">第一百零八回 强欢笑蘅芜庆生辰 死缠绵闻鬼哭</a></li><li><a href=\"/book/hongloumeng/109.html\">第一百零九回 候芳魂五儿承错爱还孽债迎女返真元</a></li><li><a href=\"/book/hongloumeng/110.html\">第一百一十回 史太君寿终归地府 王凤姐力诎失人心</a></li><li><a href=\"/book/hongloumeng/111.html\">第一百一十一回 鸳鸯女殉主登太虚 狗彘奴欺天招伙盗</a></li><li><a href=\"/book/hongloumeng/112.html\">第一百一十二回 活冤孽妙姑遭大劫 死雠仇赵妾赴冥曹</a></li><li><a href=\"/book/hongloumeng/113.html\">第一百一十三回 忏宿冤凤姐托村妪 释旧憾情婢感痴郎</a></li><li><a href=\"/book/hongloumeng/114.html\">第一百一十四回 王熙凤历幻返金陵 甄应嘉蒙恩还玉阙</a></li><li><a href=\"/book/hongloumeng/115.html\">第一百一十五回 惑偏私惜春矢素志 证同类宝玉失相知</a></li><li><a href=\"/book/hongloumeng/116.html\">第一百一十六回 得通灵幻境悟仙缘 送慈柩故乡全孝道</a></li><li><a href=\"/book/hongloumeng/117.html\">第一百一十七回 阻超凡佳人双护玉 欣聚党恶子独承家</a></li><li><a href=\"/book/hongloumeng/118.html\">第一百一十八回 记微嫌舅兄欺弱女 警谜语妻妾谏痴人</a></li><li><a href=\"/book/hongloumeng/119.html\">第一百一十九回 中乡魁宝玉却尘缘 沐皇恩贾家延世泽</a></li><li><a href=\"/book/hongloumeng/120.html\">第一百二十回 甄士隐详说太虚情 贾雨村归结红楼梦</a></li> </ul>\n",
      "</div>]\n"
     ]
    }
   ],
   "source": [
    "mulu=soup.find_all(class_='book-mulu')\n",
    "print(mulu)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 59,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[<div class=\"book-mulu\">\n",
      "<ul>\n",
      "<li><a href=\"/book/hongloumeng/1.html\">第 一 回 甄士隐梦幻识通灵 贾雨村风尘怀闺秀</a></li><li><a href=\"/book/hongloumeng/2.html\">第 二 回 贾夫人仙逝扬州城 冷子兴演说荣国府</a></li><li><a href=\"/book/hongloumeng/3.html\">第 三 回 托内兄如海酬训教 接外孙贾母惜孤女</a></li><li><a href=\"/book/hongloumeng/4.html\">第 四 回 薄命女偏逢薄命郎 葫芦僧乱判葫芦案</a></li><li><a href=\"/book/hongloumeng/5.html\">第 五 回 游幻境指迷十二钗 饮仙醪曲演红楼梦</a></li><li><a href=\"/book/hongloumeng/6.html\">第 六 回 贾宝玉初试云雨情 刘姥姥一进荣国府</a></li><li><a href=\"/book/hongloumeng/7.html\">第 七 回 送宫花贾琏戏熙凤 宴宁府宝玉会秦钟</a></li><li><a href=\"/book/hongloumeng/8.html\">第 八 回 比通灵金莺微露意 探宝钗黛玉半含酸</a></li><li><a href=\"/book/hongloumeng/9.html\">第 九 回 恋风流情友入家塾 起嫌疑顽童闹学堂</a></li><li><a href=\"/book/hongloumeng/10.html\">第 十 回 金寡妇贪利权受辱 张太医论病细穷源</a></li><li><a href=\"/book/hongloumeng/11.html\">第十一回 庆寿辰宁府排家宴 见熙凤贾瑞起淫心</a></li><li><a href=\"/book/hongloumeng/12.html\">第十二回 王熙凤毒设相思局 贾天祥正照</a></li><li><a href=\"/book/hongloumeng/13.html\">第十三回 秦可卿死封龙禁尉 王熙凤协理宁国府</a></li><li><a href=\"/book/hongloumeng/14.html\">第十四回 林如海捐馆扬州城 贾宝玉路谒北静王</a></li><li><a href=\"/book/hongloumeng/15.html\">第十五回 王凤姐弄权铁槛寺 秦鲸卿得趣馒头庵</a></li><li><a href=\"/book/hongloumeng/16.html\">第十六回 贾元春才选凤藻宫 秦鲸卿夭逝黄泉路</a></li><li><a href=\"/book/hongloumeng/17.html\">第十七回 大观园试才题对额 荣国府归省庆元宵</a></li><li><a href=\"/book/hongloumeng/18.html\">第十八回 隔珠帘父女勉忠勤 搦湘管姊弟裁题咏</a></li><li><a href=\"/book/hongloumeng/19.html\">第十九回 情切切良宵花解语 意绵绵静日玉生香</a></li><li><a href=\"/book/hongloumeng/20.html\">第二十回 王熙凤正言弹妒意 林黛玉俏语谑娇音</a></li><li><a href=\"/book/hongloumeng/21.html\">第二十一回 贤袭人娇嗔箴宝玉 俏平儿软语救贾琏</a></li><li><a href=\"/book/hongloumeng/22.html\">第二十二回 听曲文宝玉悟禅机 制灯谜贾政悲谶语</a></li><li><a href=\"/book/hongloumeng/23.html\">第二十三回 西厢记妙词通戏语 牡丹亭艳曲警芳心</a></li><li><a href=\"/book/hongloumeng/24.html\">第二十四回 醉金刚轻财尚义侠 痴女儿遗帕惹相思</a></li><li><a href=\"/book/hongloumeng/25.html\">第二十五回 魇魔法叔嫂逢五鬼 红楼梦通灵遇双真</a></li><li><a href=\"/book/hongloumeng/26.html\">第二十六回 蜂腰桥设言传密意 馆春困发幽情</a></li><li><a href=\"/book/hongloumeng/27.html\">第二十七回 滴翠亭杨妃戏彩蝶 埋香冢飞燕泣残红</a></li><li><a href=\"/book/hongloumeng/28.html\">第二十八回 蒋玉菡情赠茜香罗 薛宝钗羞笼红麝串</a></li><li><a href=\"/book/hongloumeng/29.html\">第二十九回 享福人福深还祷福 痴情女情重愈斟情</a></li><li><a href=\"/book/hongloumeng/30.html\">第三十回 宝钗借扇机带双敲 龄官划蔷痴及局外</a></li><li><a href=\"/book/hongloumeng/31.html\">第三十一回 撕扇子作千金一笑 因麒麟伏白首双星</a></li><li><a href=\"/book/hongloumeng/32.html\">第三十二回 诉肺腑心迷活宝玉 含耻辱情烈死金钏</a></li><li><a href=\"/book/hongloumeng/33.html\">第三十三回 手足眈眈小动唇舌 不肖种种大承笞挞</a></li><li><a href=\"/book/hongloumeng/34.html\">第三十四回 情中情因情感妹妹 错里错以错劝哥哥</a></li><li><a href=\"/book/hongloumeng/35.html\">第三十五回 白玉钏亲尝莲叶羹 黄金莺巧结梅花络</a></li><li><a href=\"/book/hongloumeng/36.html\">第三十六回 绣鸳鸯梦兆绛芸轩 识分定情悟梨香院</a></li><li><a href=\"/book/hongloumeng/37.html\">第三十七回 秋爽斋偶结海棠社 蘅芜苑夜拟菊花题</a></li><li><a href=\"/book/hongloumeng/38.html\">第三十八回 林魁夺菊花诗 薛蘅芜讽和螃蟹咏</a></li><li><a href=\"/book/hongloumeng/39.html\">第三十九回 村姥姥是信口开河 情哥哥偏寻根究底</a></li><li><a href=\"/book/hongloumeng/40.html\">第四十回 史太君两宴大观园 金鸳鸯三宣牙牌令</a></li><li><a href=\"/book/hongloumeng/41.html\">第四十一回 贾宝玉品茶栊翠庵 刘姥姥醉卧怡红院</a></li><li><a href=\"/book/hongloumeng/42.html\">第四十二回 蘅芜君兰言解疑癖 子雅谑补馀香</a></li><li><a href=\"/book/hongloumeng/43.html\">第四十三回 闲取乐偶攒金庆寿 不了情暂撮土为香</a></li><li><a href=\"/book/hongloumeng/44.html\">第四十四回 变生不测凤姐泼醋 喜出望外平儿理妆</a></li><li><a href=\"/book/hongloumeng/45.html\">第四十五回 金兰契互剖金兰语 风雨夕闷制风雨词</a></li><li><a href=\"/book/hongloumeng/46.html\">第四十六回 尴尬人难免尴尬事 鸳鸯女誓绝鸳鸯偶</a></li><li><a href=\"/book/hongloumeng/47.html\">第四十七回 呆霸王调情遭苦打 冷郎君惧祸走他乡</a></li><li><a href=\"/book/hongloumeng/48.html\">第四十八回 滥情人情误思游艺 慕雅女雅集苦吟诗</a></li><li><a href=\"/book/hongloumeng/49.html\">第四十九回 琉璃世界白雪红梅 脂粉香娃割腥啖膻</a></li><li><a href=\"/book/hongloumeng/50.html\">第五十回 芦雪庵争联即景诗 暖香坞雅制春灯谜</a></li><li><a href=\"/book/hongloumeng/51.html\">第五十一回 薛小妹新编怀古诗 胡庸医乱用虎狼药</a></li><li><a href=\"/book/hongloumeng/52.html\">第五十二回 俏平儿情掩虾须镯 勇晴雯病补雀金裘</a></li><li><a href=\"/book/hongloumeng/53.html\">第五十三回 宁国府除夕祭宗祠 荣国府元宵开夜宴</a></li><li><a href=\"/book/hongloumeng/54.html\">第五十四回 史太君破陈腐旧套 王熙凤效戏彩斑衣</a></li><li><a href=\"/book/hongloumeng/55.html\">第五十五回 辱亲女愚妾争闲气 欺幼主刁奴蓄险心</a></li><li><a href=\"/book/hongloumeng/56.html\">第五十六回 敏探春兴利除宿弊 识宝钗小惠全大体</a></li><li><a href=\"/book/hongloumeng/57.html\">第五十七回 慧紫鹃情辞试忙玉 慈姨妈爱语慰痴颦</a></li><li><a href=\"/book/hongloumeng/58.html\">第五十八回 杏子阴假凤泣虚凰 茜纱窗真情揆痴理</a></li><li><a href=\"/book/hongloumeng/59.html\">第五十九回 柳叶渚边嗔莺咤燕 绛芸轩里召将飞符</a></li><li><a href=\"/book/hongloumeng/60.html\">第六十回 茉莉粉替去蔷薇硝 玫瑰露引来茯苓霜</a></li><li><a href=\"/book/hongloumeng/61.html\">第六十一回 投鼠忌器宝玉瞒赃 判冤决狱平儿行权</a></li><li><a href=\"/book/hongloumeng/62.html\">第六十二回 憨湘云醉眠芍药裀 呆香菱情解石榴裙</a></li><li><a href=\"/book/hongloumeng/63.html\">第六十三回 寿怡红群芳开夜宴 死金丹独艳理亲丧</a></li><li><a href=\"/book/hongloumeng/64.html\">第六十四回 幽淑女悲题五美吟 浪荡子情遗九龙佩</a></li><li><a href=\"/book/hongloumeng/65.html\">第六十五回 贾二舍偷娶尤二姨 尤三姐思嫁柳二郎</a></li><li><a href=\"/book/hongloumeng/66.html\">第六十六回 情小妹耻情归地府 冷二郎一冷入空门</a></li><li><a href=\"/book/hongloumeng/67.html\">第六十七回 见土仪颦卿思故里 闻秘事凤姐讯家童</a></li><li><a href=\"/book/hongloumeng/68.html\">第六十八回 苦尤娘赚入大观园 酸凤姐大闹宁国府</a></li><li><a href=\"/book/hongloumeng/69.html\">第六十九回 弄小巧用借剑杀人 觉大限吞生金自逝</a></li><li><a href=\"/book/hongloumeng/70.html\">第七十回 林黛玉重建桃花社 史湘云偶填柳絮词</a></li><li><a href=\"/book/hongloumeng/71.html\">第七十一回 嫌隙人有心生嫌隙 鸳鸯女无意遇鸳鸯</a></li><li><a href=\"/book/hongloumeng/72.html\">第七十二回 王熙凤恃强羞说病 来旺妇倚势霸成亲</a></li><li><a href=\"/book/hongloumeng/73.html\">第七十三回 痴丫头误拾绣春囊 懦小姐不问累金凤</a></li><li><a href=\"/book/hongloumeng/74.html\">第七十四回 惑奸谗抄检大观园 矢孤介杜绝宁国府</a></li><li><a href=\"/book/hongloumeng/75.html\">第七十五回 开夜宴异兆发悲音 赏中秋新词得佳谶</a></li><li><a href=\"/book/hongloumeng/76.html\">第七十六回 凸碧堂品笛感凄清 凹晶馆联诗悲寂寞</a></li><li><a href=\"/book/hongloumeng/77.html\">第七十七回 俏丫鬟抱屈夭风流 美优伶斩情归水月</a></li><li><a href=\"/book/hongloumeng/78.html\">第七十八回 老学士闲徵姽嫿词 痴公子杜撰芙蓉诔</a></li><li><a href=\"/book/hongloumeng/79.html\">第七十九回 薛文龙悔娶河东狮 贾迎春误嫁中山狼</a></li><li><a href=\"/book/hongloumeng/80.html\">第八十回 美香菱屈受贪夫棒 王道士胡诌妒妇方</a></li><li><a href=\"/book/hongloumeng/81.html\">第八十一回 占旺相四美钓游鱼 奉严词两番入家塾</a></li><li><a href=\"/book/hongloumeng/82.html\">第八十二回 老学究讲义警顽心病痴魂惊恶梦</a></li><li><a href=\"/book/hongloumeng/83.html\">第八十三回 省宫闱贾元妃染恙 闹闺阃薛宝钗吞声</a></li><li><a href=\"/book/hongloumeng/84.html\">第八十四回 试文字宝玉始提亲 探惊风贾环重结怨</a></li><li><a href=\"/book/hongloumeng/85.html\">第八十五回 贾存周报升郎中任 薛文起复惹放流刑</a></li><li><a href=\"/book/hongloumeng/86.html\">第八十六回 受私贿老官翻案牍 寄闲情淑女解琴书</a></li><li><a href=\"/book/hongloumeng/87.html\">第八十七回 感秋声抚琴悲往事 坐禅寂走火入邪魔</a></li><li><a href=\"/book/hongloumeng/88.html\">第八十八回 博庭欢宝玉赞孤儿 正家法贾珍鞭悍仆</a></li><li><a href=\"/book/hongloumeng/89.html\">第八十九回 人亡物在公子填词 蛇影杯弓颦卿绝粒</a></li><li><a href=\"/book/hongloumeng/90.html\">第九十回 失绵衣贫女耐嗷嘈 送果品小郎惊叵测</a></li><li><a href=\"/book/hongloumeng/91.html\">第九十一回 纵淫心宝蟾工设计 布疑阵宝玉妄谈禅</a></li><li><a href=\"/book/hongloumeng/92.html\">第九十二回 评女传巧姐慕贤良 顽母珠贾政参聚散</a></li><li><a href=\"/book/hongloumeng/93.html\">第九十三回 甄家仆投靠贾家门 水月庵掀翻风月案</a></li><li><a href=\"/book/hongloumeng/94.html\">第九十四回 宴海棠贾母赏花妖 失宝玉通灵知奇祸</a></li><li><a href=\"/book/hongloumeng/95.html\">第九十五回 因讹成实元妃薨逝以假混真宝玉疯颠</a></li><li><a href=\"/book/hongloumeng/96.html\">第九十六回 瞒消息凤姐设奇谋 泄机关颦儿迷本性</a></li><li><a href=\"/book/hongloumeng/97.html\">第九十七回 林黛玉焚稿断痴情 薛宝钗出闺成大礼</a></li><li><a href=\"/book/hongloumeng/98.html\">第九十八回 苦绛珠魂归离恨天 病神瑛泪洒相思地</a></li><li><a href=\"/book/hongloumeng/99.html\">第九十九回 守官箴恶奴同破例 阅邸报老舅自担惊</a></li><li><a href=\"/book/hongloumeng/100.html\">第一百回 破好事香菱结深恨 悲远嫁宝玉感离情</a></li><li><a href=\"/book/hongloumeng/101.html\">第一百零一回 大观园月夜警幽魂 散花寺神签占异兆</a></li><li><a href=\"/book/hongloumeng/102.html\">第一百零二回 宁国府骨肉病灾祲 大观园符水驱妖孽</a></li><li><a href=\"/book/hongloumeng/103.html\">第一百零三回 施毒计金桂自焚身 昧真禅雨村空遇旧</a></li><li><a href=\"/book/hongloumeng/104.html\">第一百零四回 醉金刚小鳅生大浪 痴公子馀痛触前情</a></li><li><a href=\"/book/hongloumeng/105.html\">第一百零五回 锦衣军查抄宁国府 骢马使弹劾平安州</a></li><li><a href=\"/book/hongloumeng/106.html\">第一百零六回 王熙凤致祸抱羞惭 贾太君祷天消灾患</a></li><li><a href=\"/book/hongloumeng/107.html\">第一百零七回 散馀资贾母明大义 复世职政老沐天恩</a></li><li><a href=\"/book/hongloumeng/108.html\">第一百零八回 强欢笑蘅芜庆生辰 死缠绵闻鬼哭</a></li><li><a href=\"/book/hongloumeng/109.html\">第一百零九回 候芳魂五儿承错爱还孽债迎女返真元</a></li><li><a href=\"/book/hongloumeng/110.html\">第一百一十回 史太君寿终归地府 王凤姐力诎失人心</a></li><li><a href=\"/book/hongloumeng/111.html\">第一百一十一回 鸳鸯女殉主登太虚 狗彘奴欺天招伙盗</a></li><li><a href=\"/book/hongloumeng/112.html\">第一百一十二回 活冤孽妙姑遭大劫 死雠仇赵妾赴冥曹</a></li><li><a href=\"/book/hongloumeng/113.html\">第一百一十三回 忏宿冤凤姐托村妪 释旧憾情婢感痴郎</a></li><li><a href=\"/book/hongloumeng/114.html\">第一百一十四回 王熙凤历幻返金陵 甄应嘉蒙恩还玉阙</a></li><li><a href=\"/book/hongloumeng/115.html\">第一百一十五回 惑偏私惜春矢素志 证同类宝玉失相知</a></li><li><a href=\"/book/hongloumeng/116.html\">第一百一十六回 得通灵幻境悟仙缘 送慈柩故乡全孝道</a></li><li><a href=\"/book/hongloumeng/117.html\">第一百一十七回 阻超凡佳人双护玉 欣聚党恶子独承家</a></li><li><a href=\"/book/hongloumeng/118.html\">第一百一十八回 记微嫌舅兄欺弱女 警谜语妻妾谏痴人</a></li><li><a href=\"/book/hongloumeng/119.html\">第一百一十九回 中乡魁宝玉却尘缘 沐皇恩贾家延世泽</a></li><li><a href=\"/book/hongloumeng/120.html\">第一百二十回 甄士隐详说太虚情 贾雨村归结红楼梦</a></li> </ul>\n",
      "</div>]\n"
     ]
    }
   ],
   "source": [
    "mulu=soup.select('.book-mulu')\n",
    "print(mulu)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 60,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<div class=\"book-mulu\">\n",
      "<ul>\n",
      "<li><a href=\"/book/hongloumeng/1.html\">第 一 回 甄士隐梦幻识通灵 贾雨村风尘怀闺秀</a></li><li><a href=\"/book/hongloumeng/2.html\">第 二 回 贾夫人仙逝扬州城 冷子兴演说荣国府</a></li><li><a href=\"/book/hongloumeng/3.html\">第 三 回 托内兄如海酬训教 接外孙贾母惜孤女</a></li><li><a href=\"/book/hongloumeng/4.html\">第 四 回 薄命女偏逢薄命郎 葫芦僧乱判葫芦案</a></li><li><a href=\"/book/hongloumeng/5.html\">第 五 回 游幻境指迷十二钗 饮仙醪曲演红楼梦</a></li><li><a href=\"/book/hongloumeng/6.html\">第 六 回 贾宝玉初试云雨情 刘姥姥一进荣国府</a></li><li><a href=\"/book/hongloumeng/7.html\">第 七 回 送宫花贾琏戏熙凤 宴宁府宝玉会秦钟</a></li><li><a href=\"/book/hongloumeng/8.html\">第 八 回 比通灵金莺微露意 探宝钗黛玉半含酸</a></li><li><a href=\"/book/hongloumeng/9.html\">第 九 回 恋风流情友入家塾 起嫌疑顽童闹学堂</a></li><li><a href=\"/book/hongloumeng/10.html\">第 十 回 金寡妇贪利权受辱 张太医论病细穷源</a></li><li><a href=\"/book/hongloumeng/11.html\">第十一回 庆寿辰宁府排家宴 见熙凤贾瑞起淫心</a></li><li><a href=\"/book/hongloumeng/12.html\">第十二回 王熙凤毒设相思局 贾天祥正照</a></li><li><a href=\"/book/hongloumeng/13.html\">第十三回 秦可卿死封龙禁尉 王熙凤协理宁国府</a></li><li><a href=\"/book/hongloumeng/14.html\">第十四回 林如海捐馆扬州城 贾宝玉路谒北静王</a></li><li><a href=\"/book/hongloumeng/15.html\">第十五回 王凤姐弄权铁槛寺 秦鲸卿得趣馒头庵</a></li><li><a href=\"/book/hongloumeng/16.html\">第十六回 贾元春才选凤藻宫 秦鲸卿夭逝黄泉路</a></li><li><a href=\"/book/hongloumeng/17.html\">第十七回 大观园试才题对额 荣国府归省庆元宵</a></li><li><a href=\"/book/hongloumeng/18.html\">第十八回 隔珠帘父女勉忠勤 搦湘管姊弟裁题咏</a></li><li><a href=\"/book/hongloumeng/19.html\">第十九回 情切切良宵花解语 意绵绵静日玉生香</a></li><li><a href=\"/book/hongloumeng/20.html\">第二十回 王熙凤正言弹妒意 林黛玉俏语谑娇音</a></li><li><a href=\"/book/hongloumeng/21.html\">第二十一回 贤袭人娇嗔箴宝玉 俏平儿软语救贾琏</a></li><li><a href=\"/book/hongloumeng/22.html\">第二十二回 听曲文宝玉悟禅机 制灯谜贾政悲谶语</a></li><li><a href=\"/book/hongloumeng/23.html\">第二十三回 西厢记妙词通戏语 牡丹亭艳曲警芳心</a></li><li><a href=\"/book/hongloumeng/24.html\">第二十四回 醉金刚轻财尚义侠 痴女儿遗帕惹相思</a></li><li><a href=\"/book/hongloumeng/25.html\">第二十五回 魇魔法叔嫂逢五鬼 红楼梦通灵遇双真</a></li><li><a href=\"/book/hongloumeng/26.html\">第二十六回 蜂腰桥设言传密意 馆春困发幽情</a></li><li><a href=\"/book/hongloumeng/27.html\">第二十七回 滴翠亭杨妃戏彩蝶 埋香冢飞燕泣残红</a></li><li><a href=\"/book/hongloumeng/28.html\">第二十八回 蒋玉菡情赠茜香罗 薛宝钗羞笼红麝串</a></li><li><a href=\"/book/hongloumeng/29.html\">第二十九回 享福人福深还祷福 痴情女情重愈斟情</a></li><li><a href=\"/book/hongloumeng/30.html\">第三十回 宝钗借扇机带双敲 龄官划蔷痴及局外</a></li><li><a href=\"/book/hongloumeng/31.html\">第三十一回 撕扇子作千金一笑 因麒麟伏白首双星</a></li><li><a href=\"/book/hongloumeng/32.html\">第三十二回 诉肺腑心迷活宝玉 含耻辱情烈死金钏</a></li><li><a href=\"/book/hongloumeng/33.html\">第三十三回 手足眈眈小动唇舌 不肖种种大承笞挞</a></li><li><a href=\"/book/hongloumeng/34.html\">第三十四回 情中情因情感妹妹 错里错以错劝哥哥</a></li><li><a href=\"/book/hongloumeng/35.html\">第三十五回 白玉钏亲尝莲叶羹 黄金莺巧结梅花络</a></li><li><a href=\"/book/hongloumeng/36.html\">第三十六回 绣鸳鸯梦兆绛芸轩 识分定情悟梨香院</a></li><li><a href=\"/book/hongloumeng/37.html\">第三十七回 秋爽斋偶结海棠社 蘅芜苑夜拟菊花题</a></li><li><a href=\"/book/hongloumeng/38.html\">第三十八回 林魁夺菊花诗 薛蘅芜讽和螃蟹咏</a></li><li><a href=\"/book/hongloumeng/39.html\">第三十九回 村姥姥是信口开河 情哥哥偏寻根究底</a></li><li><a href=\"/book/hongloumeng/40.html\">第四十回 史太君两宴大观园 金鸳鸯三宣牙牌令</a></li><li><a href=\"/book/hongloumeng/41.html\">第四十一回 贾宝玉品茶栊翠庵 刘姥姥醉卧怡红院</a></li><li><a href=\"/book/hongloumeng/42.html\">第四十二回 蘅芜君兰言解疑癖 子雅谑补馀香</a></li><li><a href=\"/book/hongloumeng/43.html\">第四十三回 闲取乐偶攒金庆寿 不了情暂撮土为香</a></li><li><a href=\"/book/hongloumeng/44.html\">第四十四回 变生不测凤姐泼醋 喜出望外平儿理妆</a></li><li><a href=\"/book/hongloumeng/45.html\">第四十五回 金兰契互剖金兰语 风雨夕闷制风雨词</a></li><li><a href=\"/book/hongloumeng/46.html\">第四十六回 尴尬人难免尴尬事 鸳鸯女誓绝鸳鸯偶</a></li><li><a href=\"/book/hongloumeng/47.html\">第四十七回 呆霸王调情遭苦打 冷郎君惧祸走他乡</a></li><li><a href=\"/book/hongloumeng/48.html\">第四十八回 滥情人情误思游艺 慕雅女雅集苦吟诗</a></li><li><a href=\"/book/hongloumeng/49.html\">第四十九回 琉璃世界白雪红梅 脂粉香娃割腥啖膻</a></li><li><a href=\"/book/hongloumeng/50.html\">第五十回 芦雪庵争联即景诗 暖香坞雅制春灯谜</a></li><li><a href=\"/book/hongloumeng/51.html\">第五十一回 薛小妹新编怀古诗 胡庸医乱用虎狼药</a></li><li><a href=\"/book/hongloumeng/52.html\">第五十二回 俏平儿情掩虾须镯 勇晴雯病补雀金裘</a></li><li><a href=\"/book/hongloumeng/53.html\">第五十三回 宁国府除夕祭宗祠 荣国府元宵开夜宴</a></li><li><a href=\"/book/hongloumeng/54.html\">第五十四回 史太君破陈腐旧套 王熙凤效戏彩斑衣</a></li><li><a href=\"/book/hongloumeng/55.html\">第五十五回 辱亲女愚妾争闲气 欺幼主刁奴蓄险心</a></li><li><a href=\"/book/hongloumeng/56.html\">第五十六回 敏探春兴利除宿弊 识宝钗小惠全大体</a></li><li><a href=\"/book/hongloumeng/57.html\">第五十七回 慧紫鹃情辞试忙玉 慈姨妈爱语慰痴颦</a></li><li><a href=\"/book/hongloumeng/58.html\">第五十八回 杏子阴假凤泣虚凰 茜纱窗真情揆痴理</a></li><li><a href=\"/book/hongloumeng/59.html\">第五十九回 柳叶渚边嗔莺咤燕 绛芸轩里召将飞符</a></li><li><a href=\"/book/hongloumeng/60.html\">第六十回 茉莉粉替去蔷薇硝 玫瑰露引来茯苓霜</a></li><li><a href=\"/book/hongloumeng/61.html\">第六十一回 投鼠忌器宝玉瞒赃 判冤决狱平儿行权</a></li><li><a href=\"/book/hongloumeng/62.html\">第六十二回 憨湘云醉眠芍药裀 呆香菱情解石榴裙</a></li><li><a href=\"/book/hongloumeng/63.html\">第六十三回 寿怡红群芳开夜宴 死金丹独艳理亲丧</a></li><li><a href=\"/book/hongloumeng/64.html\">第六十四回 幽淑女悲题五美吟 浪荡子情遗九龙佩</a></li><li><a href=\"/book/hongloumeng/65.html\">第六十五回 贾二舍偷娶尤二姨 尤三姐思嫁柳二郎</a></li><li><a href=\"/book/hongloumeng/66.html\">第六十六回 情小妹耻情归地府 冷二郎一冷入空门</a></li><li><a href=\"/book/hongloumeng/67.html\">第六十七回 见土仪颦卿思故里 闻秘事凤姐讯家童</a></li><li><a href=\"/book/hongloumeng/68.html\">第六十八回 苦尤娘赚入大观园 酸凤姐大闹宁国府</a></li><li><a href=\"/book/hongloumeng/69.html\">第六十九回 弄小巧用借剑杀人 觉大限吞生金自逝</a></li><li><a href=\"/book/hongloumeng/70.html\">第七十回 林黛玉重建桃花社 史湘云偶填柳絮词</a></li><li><a href=\"/book/hongloumeng/71.html\">第七十一回 嫌隙人有心生嫌隙 鸳鸯女无意遇鸳鸯</a></li><li><a href=\"/book/hongloumeng/72.html\">第七十二回 王熙凤恃强羞说病 来旺妇倚势霸成亲</a></li><li><a href=\"/book/hongloumeng/73.html\">第七十三回 痴丫头误拾绣春囊 懦小姐不问累金凤</a></li><li><a href=\"/book/hongloumeng/74.html\">第七十四回 惑奸谗抄检大观园 矢孤介杜绝宁国府</a></li><li><a href=\"/book/hongloumeng/75.html\">第七十五回 开夜宴异兆发悲音 赏中秋新词得佳谶</a></li><li><a href=\"/book/hongloumeng/76.html\">第七十六回 凸碧堂品笛感凄清 凹晶馆联诗悲寂寞</a></li><li><a href=\"/book/hongloumeng/77.html\">第七十七回 俏丫鬟抱屈夭风流 美优伶斩情归水月</a></li><li><a href=\"/book/hongloumeng/78.html\">第七十八回 老学士闲徵姽嫿词 痴公子杜撰芙蓉诔</a></li><li><a href=\"/book/hongloumeng/79.html\">第七十九回 薛文龙悔娶河东狮 贾迎春误嫁中山狼</a></li><li><a href=\"/book/hongloumeng/80.html\">第八十回 美香菱屈受贪夫棒 王道士胡诌妒妇方</a></li><li><a href=\"/book/hongloumeng/81.html\">第八十一回 占旺相四美钓游鱼 奉严词两番入家塾</a></li><li><a href=\"/book/hongloumeng/82.html\">第八十二回 老学究讲义警顽心病痴魂惊恶梦</a></li><li><a href=\"/book/hongloumeng/83.html\">第八十三回 省宫闱贾元妃染恙 闹闺阃薛宝钗吞声</a></li><li><a href=\"/book/hongloumeng/84.html\">第八十四回 试文字宝玉始提亲 探惊风贾环重结怨</a></li><li><a href=\"/book/hongloumeng/85.html\">第八十五回 贾存周报升郎中任 薛文起复惹放流刑</a></li><li><a href=\"/book/hongloumeng/86.html\">第八十六回 受私贿老官翻案牍 寄闲情淑女解琴书</a></li><li><a href=\"/book/hongloumeng/87.html\">第八十七回 感秋声抚琴悲往事 坐禅寂走火入邪魔</a></li><li><a href=\"/book/hongloumeng/88.html\">第八十八回 博庭欢宝玉赞孤儿 正家法贾珍鞭悍仆</a></li><li><a href=\"/book/hongloumeng/89.html\">第八十九回 人亡物在公子填词 蛇影杯弓颦卿绝粒</a></li><li><a href=\"/book/hongloumeng/90.html\">第九十回 失绵衣贫女耐嗷嘈 送果品小郎惊叵测</a></li><li><a href=\"/book/hongloumeng/91.html\">第九十一回 纵淫心宝蟾工设计 布疑阵宝玉妄谈禅</a></li><li><a href=\"/book/hongloumeng/92.html\">第九十二回 评女传巧姐慕贤良 顽母珠贾政参聚散</a></li><li><a href=\"/book/hongloumeng/93.html\">第九十三回 甄家仆投靠贾家门 水月庵掀翻风月案</a></li><li><a href=\"/book/hongloumeng/94.html\">第九十四回 宴海棠贾母赏花妖 失宝玉通灵知奇祸</a></li><li><a href=\"/book/hongloumeng/95.html\">第九十五回 因讹成实元妃薨逝以假混真宝玉疯颠</a></li><li><a href=\"/book/hongloumeng/96.html\">第九十六回 瞒消息凤姐设奇谋 泄机关颦儿迷本性</a></li><li><a href=\"/book/hongloumeng/97.html\">第九十七回 林黛玉焚稿断痴情 薛宝钗出闺成大礼</a></li><li><a href=\"/book/hongloumeng/98.html\">第九十八回 苦绛珠魂归离恨天 病神瑛泪洒相思地</a></li><li><a href=\"/book/hongloumeng/99.html\">第九十九回 守官箴恶奴同破例 阅邸报老舅自担惊</a></li><li><a href=\"/book/hongloumeng/100.html\">第一百回 破好事香菱结深恨 悲远嫁宝玉感离情</a></li><li><a href=\"/book/hongloumeng/101.html\">第一百零一回 大观园月夜警幽魂 散花寺神签占异兆</a></li><li><a href=\"/book/hongloumeng/102.html\">第一百零二回 宁国府骨肉病灾祲 大观园符水驱妖孽</a></li><li><a href=\"/book/hongloumeng/103.html\">第一百零三回 施毒计金桂自焚身 昧真禅雨村空遇旧</a></li><li><a href=\"/book/hongloumeng/104.html\">第一百零四回 醉金刚小鳅生大浪 痴公子馀痛触前情</a></li><li><a href=\"/book/hongloumeng/105.html\">第一百零五回 锦衣军查抄宁国府 骢马使弹劾平安州</a></li><li><a href=\"/book/hongloumeng/106.html\">第一百零六回 王熙凤致祸抱羞惭 贾太君祷天消灾患</a></li><li><a href=\"/book/hongloumeng/107.html\">第一百零七回 散馀资贾母明大义 复世职政老沐天恩</a></li><li><a href=\"/book/hongloumeng/108.html\">第一百零八回 强欢笑蘅芜庆生辰 死缠绵闻鬼哭</a></li><li><a href=\"/book/hongloumeng/109.html\">第一百零九回 候芳魂五儿承错爱还孽债迎女返真元</a></li><li><a href=\"/book/hongloumeng/110.html\">第一百一十回 史太君寿终归地府 王凤姐力诎失人心</a></li><li><a href=\"/book/hongloumeng/111.html\">第一百一十一回 鸳鸯女殉主登太虚 狗彘奴欺天招伙盗</a></li><li><a href=\"/book/hongloumeng/112.html\">第一百一十二回 活冤孽妙姑遭大劫 死雠仇赵妾赴冥曹</a></li><li><a href=\"/book/hongloumeng/113.html\">第一百一十三回 忏宿冤凤姐托村妪 释旧憾情婢感痴郎</a></li><li><a href=\"/book/hongloumeng/114.html\">第一百一十四回 王熙凤历幻返金陵 甄应嘉蒙恩还玉阙</a></li><li><a href=\"/book/hongloumeng/115.html\">第一百一十五回 惑偏私惜春矢素志 证同类宝玉失相知</a></li><li><a href=\"/book/hongloumeng/116.html\">第一百一十六回 得通灵幻境悟仙缘 送慈柩故乡全孝道</a></li><li><a href=\"/book/hongloumeng/117.html\">第一百一十七回 阻超凡佳人双护玉 欣聚党恶子独承家</a></li><li><a href=\"/book/hongloumeng/118.html\">第一百一十八回 记微嫌舅兄欺弱女 警谜语妻妾谏痴人</a></li><li><a href=\"/book/hongloumeng/119.html\">第一百一十九回 中乡魁宝玉却尘缘 沐皇恩贾家延世泽</a></li><li><a href=\"/book/hongloumeng/120.html\">第一百二十回 甄士隐详说太虚情 贾雨村归结红楼梦</a></li> </ul>\n",
      "</div>\n"
     ]
    }
   ],
   "source": [
    "li=mulu[0]\n",
    "print(li)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 61,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[<a href=\"/book/hongloumeng/1.html\">第 一 回 甄士隐梦幻识通灵 贾雨村风尘怀闺秀</a>, <a href=\"/book/hongloumeng/2.html\">第 二 回 贾夫人仙逝扬州城 冷子兴演说荣国府</a>, <a href=\"/book/hongloumeng/3.html\">第 三 回 托内兄如海酬训教 接外孙贾母惜孤女</a>, <a href=\"/book/hongloumeng/4.html\">第 四 回 薄命女偏逢薄命郎 葫芦僧乱判葫芦案</a>, <a href=\"/book/hongloumeng/5.html\">第 五 回 游幻境指迷十二钗 饮仙醪曲演红楼梦</a>, <a href=\"/book/hongloumeng/6.html\">第 六 回 贾宝玉初试云雨情 刘姥姥一进荣国府</a>, <a href=\"/book/hongloumeng/7.html\">第 七 回 送宫花贾琏戏熙凤 宴宁府宝玉会秦钟</a>, <a href=\"/book/hongloumeng/8.html\">第 八 回 比通灵金莺微露意 探宝钗黛玉半含酸</a>, <a href=\"/book/hongloumeng/9.html\">第 九 回 恋风流情友入家塾 起嫌疑顽童闹学堂</a>, <a href=\"/book/hongloumeng/10.html\">第 十 回 金寡妇贪利权受辱 张太医论病细穷源</a>, <a href=\"/book/hongloumeng/11.html\">第十一回 庆寿辰宁府排家宴 见熙凤贾瑞起淫心</a>, <a href=\"/book/hongloumeng/12.html\">第十二回 王熙凤毒设相思局 贾天祥正照</a>, <a href=\"/book/hongloumeng/13.html\">第十三回 秦可卿死封龙禁尉 王熙凤协理宁国府</a>, <a href=\"/book/hongloumeng/14.html\">第十四回 林如海捐馆扬州城 贾宝玉路谒北静王</a>, <a href=\"/book/hongloumeng/15.html\">第十五回 王凤姐弄权铁槛寺 秦鲸卿得趣馒头庵</a>, <a href=\"/book/hongloumeng/16.html\">第十六回 贾元春才选凤藻宫 秦鲸卿夭逝黄泉路</a>, <a href=\"/book/hongloumeng/17.html\">第十七回 大观园试才题对额 荣国府归省庆元宵</a>, <a href=\"/book/hongloumeng/18.html\">第十八回 隔珠帘父女勉忠勤 搦湘管姊弟裁题咏</a>, <a href=\"/book/hongloumeng/19.html\">第十九回 情切切良宵花解语 意绵绵静日玉生香</a>, <a href=\"/book/hongloumeng/20.html\">第二十回 王熙凤正言弹妒意 林黛玉俏语谑娇音</a>, <a href=\"/book/hongloumeng/21.html\">第二十一回 贤袭人娇嗔箴宝玉 俏平儿软语救贾琏</a>, <a href=\"/book/hongloumeng/22.html\">第二十二回 听曲文宝玉悟禅机 制灯谜贾政悲谶语</a>, <a href=\"/book/hongloumeng/23.html\">第二十三回 西厢记妙词通戏语 牡丹亭艳曲警芳心</a>, <a href=\"/book/hongloumeng/24.html\">第二十四回 醉金刚轻财尚义侠 痴女儿遗帕惹相思</a>, <a href=\"/book/hongloumeng/25.html\">第二十五回 魇魔法叔嫂逢五鬼 红楼梦通灵遇双真</a>, <a href=\"/book/hongloumeng/26.html\">第二十六回 蜂腰桥设言传密意 馆春困发幽情</a>, <a href=\"/book/hongloumeng/27.html\">第二十七回 滴翠亭杨妃戏彩蝶 埋香冢飞燕泣残红</a>, <a href=\"/book/hongloumeng/28.html\">第二十八回 蒋玉菡情赠茜香罗 薛宝钗羞笼红麝串</a>, <a href=\"/book/hongloumeng/29.html\">第二十九回 享福人福深还祷福 痴情女情重愈斟情</a>, <a href=\"/book/hongloumeng/30.html\">第三十回 宝钗借扇机带双敲 龄官划蔷痴及局外</a>, <a href=\"/book/hongloumeng/31.html\">第三十一回 撕扇子作千金一笑 因麒麟伏白首双星</a>, <a href=\"/book/hongloumeng/32.html\">第三十二回 诉肺腑心迷活宝玉 含耻辱情烈死金钏</a>, <a href=\"/book/hongloumeng/33.html\">第三十三回 手足眈眈小动唇舌 不肖种种大承笞挞</a>, <a href=\"/book/hongloumeng/34.html\">第三十四回 情中情因情感妹妹 错里错以错劝哥哥</a>, <a href=\"/book/hongloumeng/35.html\">第三十五回 白玉钏亲尝莲叶羹 黄金莺巧结梅花络</a>, <a href=\"/book/hongloumeng/36.html\">第三十六回 绣鸳鸯梦兆绛芸轩 识分定情悟梨香院</a>, <a href=\"/book/hongloumeng/37.html\">第三十七回 秋爽斋偶结海棠社 蘅芜苑夜拟菊花题</a>, <a href=\"/book/hongloumeng/38.html\">第三十八回 林魁夺菊花诗 薛蘅芜讽和螃蟹咏</a>, <a href=\"/book/hongloumeng/39.html\">第三十九回 村姥姥是信口开河 情哥哥偏寻根究底</a>, <a href=\"/book/hongloumeng/40.html\">第四十回 史太君两宴大观园 金鸳鸯三宣牙牌令</a>, <a href=\"/book/hongloumeng/41.html\">第四十一回 贾宝玉品茶栊翠庵 刘姥姥醉卧怡红院</a>, <a href=\"/book/hongloumeng/42.html\">第四十二回 蘅芜君兰言解疑癖 子雅谑补馀香</a>, <a href=\"/book/hongloumeng/43.html\">第四十三回 闲取乐偶攒金庆寿 不了情暂撮土为香</a>, <a href=\"/book/hongloumeng/44.html\">第四十四回 变生不测凤姐泼醋 喜出望外平儿理妆</a>, <a href=\"/book/hongloumeng/45.html\">第四十五回 金兰契互剖金兰语 风雨夕闷制风雨词</a>, <a href=\"/book/hongloumeng/46.html\">第四十六回 尴尬人难免尴尬事 鸳鸯女誓绝鸳鸯偶</a>, <a href=\"/book/hongloumeng/47.html\">第四十七回 呆霸王调情遭苦打 冷郎君惧祸走他乡</a>, <a href=\"/book/hongloumeng/48.html\">第四十八回 滥情人情误思游艺 慕雅女雅集苦吟诗</a>, <a href=\"/book/hongloumeng/49.html\">第四十九回 琉璃世界白雪红梅 脂粉香娃割腥啖膻</a>, <a href=\"/book/hongloumeng/50.html\">第五十回 芦雪庵争联即景诗 暖香坞雅制春灯谜</a>, <a href=\"/book/hongloumeng/51.html\">第五十一回 薛小妹新编怀古诗 胡庸医乱用虎狼药</a>, <a href=\"/book/hongloumeng/52.html\">第五十二回 俏平儿情掩虾须镯 勇晴雯病补雀金裘</a>, <a href=\"/book/hongloumeng/53.html\">第五十三回 宁国府除夕祭宗祠 荣国府元宵开夜宴</a>, <a href=\"/book/hongloumeng/54.html\">第五十四回 史太君破陈腐旧套 王熙凤效戏彩斑衣</a>, <a href=\"/book/hongloumeng/55.html\">第五十五回 辱亲女愚妾争闲气 欺幼主刁奴蓄险心</a>, <a href=\"/book/hongloumeng/56.html\">第五十六回 敏探春兴利除宿弊 识宝钗小惠全大体</a>, <a href=\"/book/hongloumeng/57.html\">第五十七回 慧紫鹃情辞试忙玉 慈姨妈爱语慰痴颦</a>, <a href=\"/book/hongloumeng/58.html\">第五十八回 杏子阴假凤泣虚凰 茜纱窗真情揆痴理</a>, <a href=\"/book/hongloumeng/59.html\">第五十九回 柳叶渚边嗔莺咤燕 绛芸轩里召将飞符</a>, <a href=\"/book/hongloumeng/60.html\">第六十回 茉莉粉替去蔷薇硝 玫瑰露引来茯苓霜</a>, <a href=\"/book/hongloumeng/61.html\">第六十一回 投鼠忌器宝玉瞒赃 判冤决狱平儿行权</a>, <a href=\"/book/hongloumeng/62.html\">第六十二回 憨湘云醉眠芍药裀 呆香菱情解石榴裙</a>, <a href=\"/book/hongloumeng/63.html\">第六十三回 寿怡红群芳开夜宴 死金丹独艳理亲丧</a>, <a href=\"/book/hongloumeng/64.html\">第六十四回 幽淑女悲题五美吟 浪荡子情遗九龙佩</a>, <a href=\"/book/hongloumeng/65.html\">第六十五回 贾二舍偷娶尤二姨 尤三姐思嫁柳二郎</a>, <a href=\"/book/hongloumeng/66.html\">第六十六回 情小妹耻情归地府 冷二郎一冷入空门</a>, <a href=\"/book/hongloumeng/67.html\">第六十七回 见土仪颦卿思故里 闻秘事凤姐讯家童</a>, <a href=\"/book/hongloumeng/68.html\">第六十八回 苦尤娘赚入大观园 酸凤姐大闹宁国府</a>, <a href=\"/book/hongloumeng/69.html\">第六十九回 弄小巧用借剑杀人 觉大限吞生金自逝</a>, <a href=\"/book/hongloumeng/70.html\">第七十回 林黛玉重建桃花社 史湘云偶填柳絮词</a>, <a href=\"/book/hongloumeng/71.html\">第七十一回 嫌隙人有心生嫌隙 鸳鸯女无意遇鸳鸯</a>, <a href=\"/book/hongloumeng/72.html\">第七十二回 王熙凤恃强羞说病 来旺妇倚势霸成亲</a>, <a href=\"/book/hongloumeng/73.html\">第七十三回 痴丫头误拾绣春囊 懦小姐不问累金凤</a>, <a href=\"/book/hongloumeng/74.html\">第七十四回 惑奸谗抄检大观园 矢孤介杜绝宁国府</a>, <a href=\"/book/hongloumeng/75.html\">第七十五回 开夜宴异兆发悲音 赏中秋新词得佳谶</a>, <a href=\"/book/hongloumeng/76.html\">第七十六回 凸碧堂品笛感凄清 凹晶馆联诗悲寂寞</a>, <a href=\"/book/hongloumeng/77.html\">第七十七回 俏丫鬟抱屈夭风流 美优伶斩情归水月</a>, <a href=\"/book/hongloumeng/78.html\">第七十八回 老学士闲徵姽嫿词 痴公子杜撰芙蓉诔</a>, <a href=\"/book/hongloumeng/79.html\">第七十九回 薛文龙悔娶河东狮 贾迎春误嫁中山狼</a>, <a href=\"/book/hongloumeng/80.html\">第八十回 美香菱屈受贪夫棒 王道士胡诌妒妇方</a>, <a href=\"/book/hongloumeng/81.html\">第八十一回 占旺相四美钓游鱼 奉严词两番入家塾</a>, <a href=\"/book/hongloumeng/82.html\">第八十二回 老学究讲义警顽心病痴魂惊恶梦</a>, <a href=\"/book/hongloumeng/83.html\">第八十三回 省宫闱贾元妃染恙 闹闺阃薛宝钗吞声</a>, <a href=\"/book/hongloumeng/84.html\">第八十四回 试文字宝玉始提亲 探惊风贾环重结怨</a>, <a href=\"/book/hongloumeng/85.html\">第八十五回 贾存周报升郎中任 薛文起复惹放流刑</a>, <a href=\"/book/hongloumeng/86.html\">第八十六回 受私贿老官翻案牍 寄闲情淑女解琴书</a>, <a href=\"/book/hongloumeng/87.html\">第八十七回 感秋声抚琴悲往事 坐禅寂走火入邪魔</a>, <a href=\"/book/hongloumeng/88.html\">第八十八回 博庭欢宝玉赞孤儿 正家法贾珍鞭悍仆</a>, <a href=\"/book/hongloumeng/89.html\">第八十九回 人亡物在公子填词 蛇影杯弓颦卿绝粒</a>, <a href=\"/book/hongloumeng/90.html\">第九十回 失绵衣贫女耐嗷嘈 送果品小郎惊叵测</a>, <a href=\"/book/hongloumeng/91.html\">第九十一回 纵淫心宝蟾工设计 布疑阵宝玉妄谈禅</a>, <a href=\"/book/hongloumeng/92.html\">第九十二回 评女传巧姐慕贤良 顽母珠贾政参聚散</a>, <a href=\"/book/hongloumeng/93.html\">第九十三回 甄家仆投靠贾家门 水月庵掀翻风月案</a>, <a href=\"/book/hongloumeng/94.html\">第九十四回 宴海棠贾母赏花妖 失宝玉通灵知奇祸</a>, <a href=\"/book/hongloumeng/95.html\">第九十五回 因讹成实元妃薨逝以假混真宝玉疯颠</a>, <a href=\"/book/hongloumeng/96.html\">第九十六回 瞒消息凤姐设奇谋 泄机关颦儿迷本性</a>, <a href=\"/book/hongloumeng/97.html\">第九十七回 林黛玉焚稿断痴情 薛宝钗出闺成大礼</a>, <a href=\"/book/hongloumeng/98.html\">第九十八回 苦绛珠魂归离恨天 病神瑛泪洒相思地</a>, <a href=\"/book/hongloumeng/99.html\">第九十九回 守官箴恶奴同破例 阅邸报老舅自担惊</a>, <a href=\"/book/hongloumeng/100.html\">第一百回 破好事香菱结深恨 悲远嫁宝玉感离情</a>, <a href=\"/book/hongloumeng/101.html\">第一百零一回 大观园月夜警幽魂 散花寺神签占异兆</a>, <a href=\"/book/hongloumeng/102.html\">第一百零二回 宁国府骨肉病灾祲 大观园符水驱妖孽</a>, <a href=\"/book/hongloumeng/103.html\">第一百零三回 施毒计金桂自焚身 昧真禅雨村空遇旧</a>, <a href=\"/book/hongloumeng/104.html\">第一百零四回 醉金刚小鳅生大浪 痴公子馀痛触前情</a>, <a href=\"/book/hongloumeng/105.html\">第一百零五回 锦衣军查抄宁国府 骢马使弹劾平安州</a>, <a href=\"/book/hongloumeng/106.html\">第一百零六回 王熙凤致祸抱羞惭 贾太君祷天消灾患</a>, <a href=\"/book/hongloumeng/107.html\">第一百零七回 散馀资贾母明大义 复世职政老沐天恩</a>, <a href=\"/book/hongloumeng/108.html\">第一百零八回 强欢笑蘅芜庆生辰 死缠绵闻鬼哭</a>, <a href=\"/book/hongloumeng/109.html\">第一百零九回 候芳魂五儿承错爱还孽债迎女返真元</a>, <a href=\"/book/hongloumeng/110.html\">第一百一十回 史太君寿终归地府 王凤姐力诎失人心</a>, <a href=\"/book/hongloumeng/111.html\">第一百一十一回 鸳鸯女殉主登太虚 狗彘奴欺天招伙盗</a>, <a href=\"/book/hongloumeng/112.html\">第一百一十二回 活冤孽妙姑遭大劫 死雠仇赵妾赴冥曹</a>, <a href=\"/book/hongloumeng/113.html\">第一百一十三回 忏宿冤凤姐托村妪 释旧憾情婢感痴郎</a>, <a href=\"/book/hongloumeng/114.html\">第一百一十四回 王熙凤历幻返金陵 甄应嘉蒙恩还玉阙</a>, <a href=\"/book/hongloumeng/115.html\">第一百一十五回 惑偏私惜春矢素志 证同类宝玉失相知</a>, <a href=\"/book/hongloumeng/116.html\">第一百一十六回 得通灵幻境悟仙缘 送慈柩故乡全孝道</a>, <a href=\"/book/hongloumeng/117.html\">第一百一十七回 阻超凡佳人双护玉 欣聚党恶子独承家</a>, <a href=\"/book/hongloumeng/118.html\">第一百一十八回 记微嫌舅兄欺弱女 警谜语妻妾谏痴人</a>, <a href=\"/book/hongloumeng/119.html\">第一百一十九回 中乡魁宝玉却尘缘 沐皇恩贾家延世泽</a>, <a href=\"/book/hongloumeng/120.html\">第一百二十回 甄士隐详说太虚情 贾雨村归结红楼梦</a>]\n"
     ]
    }
   ],
   "source": [
    "a=li.find_all('a')\n",
    "print(a)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 62,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "https://www.shicimingju.com/book/hongloumeng/1.html\n",
      "第 一 回 甄士隐梦幻识通灵 贾雨村风尘怀闺秀\n",
      "第 一 回 甄士隐梦幻识通灵 贾雨村风尘怀闺秀--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/2.html\n",
      "第 二 回 贾夫人仙逝扬州城 冷子兴演说荣国府\n",
      "第 二 回 贾夫人仙逝扬州城 冷子兴演说荣国府--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/3.html\n",
      "第 三 回 托内兄如海酬训教 接外孙贾母惜孤女\n",
      "第 三 回 托内兄如海酬训教 接外孙贾母惜孤女--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/4.html\n",
      "第 四 回 薄命女偏逢薄命郎 葫芦僧乱判葫芦案\n",
      "第 四 回 薄命女偏逢薄命郎 葫芦僧乱判葫芦案--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/5.html\n",
      "第 五 回 游幻境指迷十二钗 饮仙醪曲演红楼梦\n",
      "第 五 回 游幻境指迷十二钗 饮仙醪曲演红楼梦--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/6.html\n",
      "第 六 回 贾宝玉初试云雨情 刘姥姥一进荣国府\n",
      "第 六 回 贾宝玉初试云雨情 刘姥姥一进荣国府--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/7.html\n",
      "第 七 回 送宫花贾琏戏熙凤 宴宁府宝玉会秦钟\n",
      "第 七 回 送宫花贾琏戏熙凤 宴宁府宝玉会秦钟--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/8.html\n",
      "第 八 回 比通灵金莺微露意 探宝钗黛玉半含酸\n",
      "第 八 回 比通灵金莺微露意 探宝钗黛玉半含酸--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/9.html\n",
      "第 九 回 恋风流情友入家塾 起嫌疑顽童闹学堂\n",
      "第 九 回 恋风流情友入家塾 起嫌疑顽童闹学堂--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/10.html\n",
      "第 十 回 金寡妇贪利权受辱 张太医论病细穷源\n",
      "第 十 回 金寡妇贪利权受辱 张太医论病细穷源--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/11.html\n",
      "第十一回 庆寿辰宁府排家宴 见熙凤贾瑞起淫心\n",
      "第十一回 庆寿辰宁府排家宴 见熙凤贾瑞起淫心--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/12.html\n",
      "第十二回 王熙凤毒设相思局 贾天祥正照\n",
      "第十二回 王熙凤毒设相思局 贾天祥正照--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/13.html\n",
      "第十三回 秦可卿死封龙禁尉 王熙凤协理宁国府\n",
      "第十三回 秦可卿死封龙禁尉 王熙凤协理宁国府--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/14.html\n",
      "第十四回 林如海捐馆扬州城 贾宝玉路谒北静王\n",
      "第十四回 林如海捐馆扬州城 贾宝玉路谒北静王--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/15.html\n",
      "第十五回 王凤姐弄权铁槛寺 秦鲸卿得趣馒头庵\n",
      "第十五回 王凤姐弄权铁槛寺 秦鲸卿得趣馒头庵--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/16.html\n",
      "第十六回 贾元春才选凤藻宫 秦鲸卿夭逝黄泉路\n",
      "第十六回 贾元春才选凤藻宫 秦鲸卿夭逝黄泉路--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/17.html\n",
      "第十七回 大观园试才题对额 荣国府归省庆元宵\n",
      "第十七回 大观园试才题对额 荣国府归省庆元宵--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/18.html\n",
      "第十八回 隔珠帘父女勉忠勤 搦湘管姊弟裁题咏\n",
      "第十八回 隔珠帘父女勉忠勤 搦湘管姊弟裁题咏--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/19.html\n",
      "第十九回 情切切良宵花解语 意绵绵静日玉生香\n",
      "第十九回 情切切良宵花解语 意绵绵静日玉生香--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/20.html\n",
      "第二十回 王熙凤正言弹妒意 林黛玉俏语谑娇音\n",
      "第二十回 王熙凤正言弹妒意 林黛玉俏语谑娇音--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/21.html\n",
      "第二十一回 贤袭人娇嗔箴宝玉 俏平儿软语救贾琏\n",
      "第二十一回 贤袭人娇嗔箴宝玉 俏平儿软语救贾琏--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/22.html\n",
      "第二十二回 听曲文宝玉悟禅机 制灯谜贾政悲谶语\n",
      "第二十二回 听曲文宝玉悟禅机 制灯谜贾政悲谶语--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/23.html\n",
      "第二十三回 西厢记妙词通戏语 牡丹亭艳曲警芳心\n",
      "第二十三回 西厢记妙词通戏语 牡丹亭艳曲警芳心--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/24.html\n",
      "第二十四回 醉金刚轻财尚义侠 痴女儿遗帕惹相思\n",
      "第二十四回 醉金刚轻财尚义侠 痴女儿遗帕惹相思--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/25.html\n",
      "第二十五回 魇魔法叔嫂逢五鬼 红楼梦通灵遇双真\n",
      "第二十五回 魇魔法叔嫂逢五鬼 红楼梦通灵遇双真--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/26.html\n",
      "第二十六回 蜂腰桥设言传密意 馆春困发幽情\n",
      "第二十六回 蜂腰桥设言传密意 馆春困发幽情--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/27.html\n",
      "第二十七回 滴翠亭杨妃戏彩蝶 埋香冢飞燕泣残红\n",
      "第二十七回 滴翠亭杨妃戏彩蝶 埋香冢飞燕泣残红--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/28.html\n",
      "第二十八回 蒋玉菡情赠茜香罗 薛宝钗羞笼红麝串\n",
      "第二十八回 蒋玉菡情赠茜香罗 薛宝钗羞笼红麝串--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/29.html\n",
      "第二十九回 享福人福深还祷福 痴情女情重愈斟情\n",
      "第二十九回 享福人福深还祷福 痴情女情重愈斟情--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/30.html\n",
      "第三十回 宝钗借扇机带双敲 龄官划蔷痴及局外\n",
      "第三十回 宝钗借扇机带双敲 龄官划蔷痴及局外--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/31.html\n",
      "第三十一回 撕扇子作千金一笑 因麒麟伏白首双星\n",
      "第三十一回 撕扇子作千金一笑 因麒麟伏白首双星--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/32.html\n",
      "第三十二回 诉肺腑心迷活宝玉 含耻辱情烈死金钏\n",
      "第三十二回 诉肺腑心迷活宝玉 含耻辱情烈死金钏--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/33.html\n",
      "第三十三回 手足眈眈小动唇舌 不肖种种大承笞挞\n",
      "第三十三回 手足眈眈小动唇舌 不肖种种大承笞挞--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/34.html\n",
      "第三十四回 情中情因情感妹妹 错里错以错劝哥哥\n",
      "第三十四回 情中情因情感妹妹 错里错以错劝哥哥--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/35.html\n",
      "第三十五回 白玉钏亲尝莲叶羹 黄金莺巧结梅花络\n",
      "第三十五回 白玉钏亲尝莲叶羹 黄金莺巧结梅花络--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/36.html\n",
      "第三十六回 绣鸳鸯梦兆绛芸轩 识分定情悟梨香院\n",
      "第三十六回 绣鸳鸯梦兆绛芸轩 识分定情悟梨香院--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/37.html\n",
      "第三十七回 秋爽斋偶结海棠社 蘅芜苑夜拟菊花题\n",
      "第三十七回 秋爽斋偶结海棠社 蘅芜苑夜拟菊花题--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/38.html\n",
      "第三十八回 林魁夺菊花诗 薛蘅芜讽和螃蟹咏\n",
      "第三十八回 林魁夺菊花诗 薛蘅芜讽和螃蟹咏--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/39.html\n",
      "第三十九回 村姥姥是信口开河 情哥哥偏寻根究底\n",
      "第三十九回 村姥姥是信口开河 情哥哥偏寻根究底--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/40.html\n",
      "第四十回 史太君两宴大观园 金鸳鸯三宣牙牌令\n",
      "第四十回 史太君两宴大观园 金鸳鸯三宣牙牌令--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/41.html\n",
      "第四十一回 贾宝玉品茶栊翠庵 刘姥姥醉卧怡红院\n",
      "第四十一回 贾宝玉品茶栊翠庵 刘姥姥醉卧怡红院--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/42.html\n",
      "第四十二回 蘅芜君兰言解疑癖 子雅谑补馀香\n",
      "第四十二回 蘅芜君兰言解疑癖 子雅谑补馀香--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/43.html\n",
      "第四十三回 闲取乐偶攒金庆寿 不了情暂撮土为香\n",
      "第四十三回 闲取乐偶攒金庆寿 不了情暂撮土为香--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/44.html\n",
      "第四十四回 变生不测凤姐泼醋 喜出望外平儿理妆\n",
      "第四十四回 变生不测凤姐泼醋 喜出望外平儿理妆--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/45.html\n",
      "第四十五回 金兰契互剖金兰语 风雨夕闷制风雨词\n",
      "第四十五回 金兰契互剖金兰语 风雨夕闷制风雨词--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/46.html\n",
      "第四十六回 尴尬人难免尴尬事 鸳鸯女誓绝鸳鸯偶\n",
      "第四十六回 尴尬人难免尴尬事 鸳鸯女誓绝鸳鸯偶--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/47.html\n",
      "第四十七回 呆霸王调情遭苦打 冷郎君惧祸走他乡\n",
      "第四十七回 呆霸王调情遭苦打 冷郎君惧祸走他乡--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/48.html\n",
      "第四十八回 滥情人情误思游艺 慕雅女雅集苦吟诗\n",
      "第四十八回 滥情人情误思游艺 慕雅女雅集苦吟诗--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/49.html\n",
      "第四十九回 琉璃世界白雪红梅 脂粉香娃割腥啖膻\n",
      "第四十九回 琉璃世界白雪红梅 脂粉香娃割腥啖膻--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/50.html\n",
      "第五十回 芦雪庵争联即景诗 暖香坞雅制春灯谜\n",
      "第五十回 芦雪庵争联即景诗 暖香坞雅制春灯谜--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/51.html\n",
      "第五十一回 薛小妹新编怀古诗 胡庸医乱用虎狼药\n",
      "第五十一回 薛小妹新编怀古诗 胡庸医乱用虎狼药--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/52.html\n",
      "第五十二回 俏平儿情掩虾须镯 勇晴雯病补雀金裘\n",
      "第五十二回 俏平儿情掩虾须镯 勇晴雯病补雀金裘--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/53.html\n",
      "第五十三回 宁国府除夕祭宗祠 荣国府元宵开夜宴\n",
      "第五十三回 宁国府除夕祭宗祠 荣国府元宵开夜宴--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/54.html\n",
      "第五十四回 史太君破陈腐旧套 王熙凤效戏彩斑衣\n",
      "第五十四回 史太君破陈腐旧套 王熙凤效戏彩斑衣--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/55.html\n",
      "第五十五回 辱亲女愚妾争闲气 欺幼主刁奴蓄险心\n",
      "第五十五回 辱亲女愚妾争闲气 欺幼主刁奴蓄险心--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/56.html\n",
      "第五十六回 敏探春兴利除宿弊 识宝钗小惠全大体\n",
      "第五十六回 敏探春兴利除宿弊 识宝钗小惠全大体--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/57.html\n",
      "第五十七回 慧紫鹃情辞试忙玉 慈姨妈爱语慰痴颦\n",
      "第五十七回 慧紫鹃情辞试忙玉 慈姨妈爱语慰痴颦--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/58.html\n",
      "第五十八回 杏子阴假凤泣虚凰 茜纱窗真情揆痴理\n",
      "第五十八回 杏子阴假凤泣虚凰 茜纱窗真情揆痴理--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/59.html\n",
      "第五十九回 柳叶渚边嗔莺咤燕 绛芸轩里召将飞符\n",
      "第五十九回 柳叶渚边嗔莺咤燕 绛芸轩里召将飞符--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/60.html\n",
      "第六十回 茉莉粉替去蔷薇硝 玫瑰露引来茯苓霜\n",
      "第六十回 茉莉粉替去蔷薇硝 玫瑰露引来茯苓霜--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/61.html\n",
      "第六十一回 投鼠忌器宝玉瞒赃 判冤决狱平儿行权\n",
      "第六十一回 投鼠忌器宝玉瞒赃 判冤决狱平儿行权--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/62.html\n",
      "第六十二回 憨湘云醉眠芍药裀 呆香菱情解石榴裙\n",
      "第六十二回 憨湘云醉眠芍药裀 呆香菱情解石榴裙--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/63.html\n",
      "第六十三回 寿怡红群芳开夜宴 死金丹独艳理亲丧\n",
      "第六十三回 寿怡红群芳开夜宴 死金丹独艳理亲丧--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/64.html\n",
      "第六十四回 幽淑女悲题五美吟 浪荡子情遗九龙佩\n",
      "第六十四回 幽淑女悲题五美吟 浪荡子情遗九龙佩--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/65.html\n",
      "第六十五回 贾二舍偷娶尤二姨 尤三姐思嫁柳二郎\n",
      "第六十五回 贾二舍偷娶尤二姨 尤三姐思嫁柳二郎--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/66.html\n",
      "第六十六回 情小妹耻情归地府 冷二郎一冷入空门\n",
      "第六十六回 情小妹耻情归地府 冷二郎一冷入空门--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/67.html\n",
      "第六十七回 见土仪颦卿思故里 闻秘事凤姐讯家童\n",
      "第六十七回 见土仪颦卿思故里 闻秘事凤姐讯家童--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/68.html\n",
      "第六十八回 苦尤娘赚入大观园 酸凤姐大闹宁国府\n",
      "第六十八回 苦尤娘赚入大观园 酸凤姐大闹宁国府--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/69.html\n",
      "第六十九回 弄小巧用借剑杀人 觉大限吞生金自逝\n",
      "第六十九回 弄小巧用借剑杀人 觉大限吞生金自逝--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/70.html\n",
      "第七十回 林黛玉重建桃花社 史湘云偶填柳絮词\n",
      "第七十回 林黛玉重建桃花社 史湘云偶填柳絮词--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/71.html\n",
      "第七十一回 嫌隙人有心生嫌隙 鸳鸯女无意遇鸳鸯\n",
      "第七十一回 嫌隙人有心生嫌隙 鸳鸯女无意遇鸳鸯--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/72.html\n",
      "第七十二回 王熙凤恃强羞说病 来旺妇倚势霸成亲\n",
      "第七十二回 王熙凤恃强羞说病 来旺妇倚势霸成亲--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/73.html\n",
      "第七十三回 痴丫头误拾绣春囊 懦小姐不问累金凤\n",
      "第七十三回 痴丫头误拾绣春囊 懦小姐不问累金凤--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/74.html\n",
      "第七十四回 惑奸谗抄检大观园 矢孤介杜绝宁国府\n",
      "第七十四回 惑奸谗抄检大观园 矢孤介杜绝宁国府--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/75.html\n",
      "第七十五回 开夜宴异兆发悲音 赏中秋新词得佳谶\n",
      "第七十五回 开夜宴异兆发悲音 赏中秋新词得佳谶--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/76.html\n",
      "第七十六回 凸碧堂品笛感凄清 凹晶馆联诗悲寂寞\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "第七十六回 凸碧堂品笛感凄清 凹晶馆联诗悲寂寞--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/77.html\n",
      "第七十七回 俏丫鬟抱屈夭风流 美优伶斩情归水月\n",
      "第七十七回 俏丫鬟抱屈夭风流 美优伶斩情归水月--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/78.html\n",
      "第七十八回 老学士闲徵姽嫿词 痴公子杜撰芙蓉诔\n",
      "第七十八回 老学士闲徵姽嫿词 痴公子杜撰芙蓉诔--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/79.html\n",
      "第七十九回 薛文龙悔娶河东狮 贾迎春误嫁中山狼\n",
      "第七十九回 薛文龙悔娶河东狮 贾迎春误嫁中山狼--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/80.html\n",
      "第八十回 美香菱屈受贪夫棒 王道士胡诌妒妇方\n",
      "第八十回 美香菱屈受贪夫棒 王道士胡诌妒妇方--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/81.html\n",
      "第八十一回 占旺相四美钓游鱼 奉严词两番入家塾\n",
      "第八十一回 占旺相四美钓游鱼 奉严词两番入家塾--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/82.html\n",
      "第八十二回 老学究讲义警顽心病痴魂惊恶梦\n",
      "第八十二回 老学究讲义警顽心病痴魂惊恶梦--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/83.html\n",
      "第八十三回 省宫闱贾元妃染恙 闹闺阃薛宝钗吞声\n",
      "第八十三回 省宫闱贾元妃染恙 闹闺阃薛宝钗吞声--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/84.html\n",
      "第八十四回 试文字宝玉始提亲 探惊风贾环重结怨\n",
      "第八十四回 试文字宝玉始提亲 探惊风贾环重结怨--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/85.html\n",
      "第八十五回 贾存周报升郎中任 薛文起复惹放流刑\n",
      "第八十五回 贾存周报升郎中任 薛文起复惹放流刑--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/86.html\n",
      "第八十六回 受私贿老官翻案牍 寄闲情淑女解琴书\n",
      "第八十六回 受私贿老官翻案牍 寄闲情淑女解琴书--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/87.html\n",
      "第八十七回 感秋声抚琴悲往事 坐禅寂走火入邪魔\n",
      "第八十七回 感秋声抚琴悲往事 坐禅寂走火入邪魔--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/88.html\n",
      "第八十八回 博庭欢宝玉赞孤儿 正家法贾珍鞭悍仆\n",
      "第八十八回 博庭欢宝玉赞孤儿 正家法贾珍鞭悍仆--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/89.html\n",
      "第八十九回 人亡物在公子填词 蛇影杯弓颦卿绝粒\n",
      "第八十九回 人亡物在公子填词 蛇影杯弓颦卿绝粒--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/90.html\n",
      "第九十回 失绵衣贫女耐嗷嘈 送果品小郎惊叵测\n",
      "第九十回 失绵衣贫女耐嗷嘈 送果品小郎惊叵测--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/91.html\n",
      "第九十一回 纵淫心宝蟾工设计 布疑阵宝玉妄谈禅\n",
      "第九十一回 纵淫心宝蟾工设计 布疑阵宝玉妄谈禅--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/92.html\n",
      "第九十二回 评女传巧姐慕贤良 顽母珠贾政参聚散\n",
      "第九十二回 评女传巧姐慕贤良 顽母珠贾政参聚散--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/93.html\n",
      "第九十三回 甄家仆投靠贾家门 水月庵掀翻风月案\n",
      "第九十三回 甄家仆投靠贾家门 水月庵掀翻风月案--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/94.html\n",
      "第九十四回 宴海棠贾母赏花妖 失宝玉通灵知奇祸\n",
      "第九十四回 宴海棠贾母赏花妖 失宝玉通灵知奇祸--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/95.html\n",
      "第九十五回 因讹成实元妃薨逝以假混真宝玉疯颠\n",
      "第九十五回 因讹成实元妃薨逝以假混真宝玉疯颠--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/96.html\n",
      "第九十六回 瞒消息凤姐设奇谋 泄机关颦儿迷本性\n",
      "第九十六回 瞒消息凤姐设奇谋 泄机关颦儿迷本性--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/97.html\n",
      "第九十七回 林黛玉焚稿断痴情 薛宝钗出闺成大礼\n",
      "第九十七回 林黛玉焚稿断痴情 薛宝钗出闺成大礼--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/98.html\n",
      "第九十八回 苦绛珠魂归离恨天 病神瑛泪洒相思地\n",
      "第九十八回 苦绛珠魂归离恨天 病神瑛泪洒相思地--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/99.html\n",
      "第九十九回 守官箴恶奴同破例 阅邸报老舅自担惊\n",
      "第九十九回 守官箴恶奴同破例 阅邸报老舅自担惊--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/100.html\n",
      "第一百回 破好事香菱结深恨 悲远嫁宝玉感离情\n",
      "第一百回 破好事香菱结深恨 悲远嫁宝玉感离情--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/101.html\n",
      "第一百零一回 大观园月夜警幽魂 散花寺神签占异兆\n",
      "第一百零一回 大观园月夜警幽魂 散花寺神签占异兆--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/102.html\n",
      "第一百零二回 宁国府骨肉病灾祲 大观园符水驱妖孽\n",
      "第一百零二回 宁国府骨肉病灾祲 大观园符水驱妖孽--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/103.html\n",
      "第一百零三回 施毒计金桂自焚身 昧真禅雨村空遇旧\n",
      "第一百零三回 施毒计金桂自焚身 昧真禅雨村空遇旧--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/104.html\n",
      "第一百零四回 醉金刚小鳅生大浪 痴公子馀痛触前情\n",
      "第一百零四回 醉金刚小鳅生大浪 痴公子馀痛触前情--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/105.html\n",
      "第一百零五回 锦衣军查抄宁国府 骢马使弹劾平安州\n",
      "第一百零五回 锦衣军查抄宁国府 骢马使弹劾平安州--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/106.html\n",
      "第一百零六回 王熙凤致祸抱羞惭 贾太君祷天消灾患\n",
      "第一百零六回 王熙凤致祸抱羞惭 贾太君祷天消灾患--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/107.html\n",
      "第一百零七回 散馀资贾母明大义 复世职政老沐天恩\n",
      "第一百零七回 散馀资贾母明大义 复世职政老沐天恩--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/108.html\n",
      "第一百零八回 强欢笑蘅芜庆生辰 死缠绵闻鬼哭\n",
      "第一百零八回 强欢笑蘅芜庆生辰 死缠绵闻鬼哭--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/109.html\n",
      "第一百零九回 候芳魂五儿承错爱还孽债迎女返真元\n",
      "第一百零九回 候芳魂五儿承错爱还孽债迎女返真元--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/110.html\n",
      "第一百一十回 史太君寿终归地府 王凤姐力诎失人心\n",
      "第一百一十回 史太君寿终归地府 王凤姐力诎失人心--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/111.html\n",
      "第一百一十一回 鸳鸯女殉主登太虚 狗彘奴欺天招伙盗\n",
      "第一百一十一回 鸳鸯女殉主登太虚 狗彘奴欺天招伙盗--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/112.html\n",
      "第一百一十二回 活冤孽妙姑遭大劫 死雠仇赵妾赴冥曹\n",
      "第一百一十二回 活冤孽妙姑遭大劫 死雠仇赵妾赴冥曹--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/113.html\n",
      "第一百一十三回 忏宿冤凤姐托村妪 释旧憾情婢感痴郎\n",
      "第一百一十三回 忏宿冤凤姐托村妪 释旧憾情婢感痴郎--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/114.html\n",
      "第一百一十四回 王熙凤历幻返金陵 甄应嘉蒙恩还玉阙\n",
      "第一百一十四回 王熙凤历幻返金陵 甄应嘉蒙恩还玉阙--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/115.html\n",
      "第一百一十五回 惑偏私惜春矢素志 证同类宝玉失相知\n",
      "第一百一十五回 惑偏私惜春矢素志 证同类宝玉失相知--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/116.html\n",
      "第一百一十六回 得通灵幻境悟仙缘 送慈柩故乡全孝道\n",
      "第一百一十六回 得通灵幻境悟仙缘 送慈柩故乡全孝道--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/117.html\n",
      "第一百一十七回 阻超凡佳人双护玉 欣聚党恶子独承家\n",
      "第一百一十七回 阻超凡佳人双护玉 欣聚党恶子独承家--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/118.html\n",
      "第一百一十八回 记微嫌舅兄欺弱女 警谜语妻妾谏痴人\n",
      "第一百一十八回 记微嫌舅兄欺弱女 警谜语妻妾谏痴人--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/119.html\n",
      "第一百一十九回 中乡魁宝玉却尘缘 沐皇恩贾家延世泽\n",
      "第一百一十九回 中乡魁宝玉却尘缘 沐皇恩贾家延世泽--章节下载成功！\n",
      "https://www.shicimingju.com/book/hongloumeng/120.html\n",
      "第一百二十回 甄士隐详说太虚情 贾雨村归结红楼梦\n",
      "第一百二十回 甄士隐详说太虚情 贾雨村归结红楼梦--章节下载成功！\n"
     ]
    }
   ],
   "source": [
    "for i in a:\n",
    "    title = i.string\n",
    "    href=i['href']\n",
    "    new_url = 'https://www.shicimingju.com' + href  #拼接\n",
    "    print(new_url)\n",
    "    print(title)\n",
    "    html=requests.get(url=new_url,headers=headers).content.decode('utf-8')\n",
    "    new_soup=BeautifulSoup(html,'lxml')\n",
    "    for  wenben in new_soup.find_all(class_='chapter_content'):\n",
    "#             print(wenben.text)\n",
    "              c=wenben.text\n",
    "              with open(title +'.text', 'a', encoding='utf-8') as f:\n",
    "                  f.write(c)\n",
    "                  print('%s--章节下载成功！' % title)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 实战方法二"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 63,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "https://www.shicimingju.com/book/hongloumeng/1.html\n",
      "<!DOCTYPE html>\n",
      "<html lang=\"zh\">\n",
      "<head>\n",
      "\t<script type=\"text/javascript\" src=\"https://ip.ws.126.net/ipquery\"></script>\n",
      "    <script src=\"/newpage/js/all.js\"></script>\n",
      "    <meta charset=\"UTF-8\">\n",
      "    <title>卷一_《虎钤经》_诗词名句网</title>\n",
      "    <meta name=\"viewport\" content=\"width=device-width,user-scalable=no\" />\n",
      "    <meta name=\"description\" content=\"\" />\n",
      "    <link rel=\"stylesheet\" href=\"/public/css/www_v3.css\">\n",
      "    <link rel=\"stylesheet\" href=\"/public/css/font_576092_m2icqcebp7evzpvi.css\">\n",
      "    <script src=\"/public/js/device.js\"></script>\n",
      "    <script src=\"/public/js/jq.js\"></script>\n",
      "    <script src=\"/public/js/www_v3.js\"></script>\n",
      "</head>\n",
      "<body>\n",
      "<div id=\"top_bar\">\n",
      "    <div id=\"top_bar_main\">\n",
      "        <div id=\"top_left\">\n",
      "            <a href=\"/\"><img src=\"/public/image/logo.png\" id=\"logo\"/></a>\n",
      "            <div id=\"top_left_menu\">\n",
      "                <ul>\n",
      "                    <li><a href=\"/\">首页</a></li>\n",
      "                    <li><a href=\"/shicimark\">分类</a></li>\n",
      "                    <li><a href=\"/category/all\">作者</a></li>\n",
      "                    <li><a href=\"/paiming\">排行榜</a></li>\n",
      "                    <li><a href=\"/cate?cate_id=4\">课本古诗</a></li>\n",
      "                    <li><a href=\"/cipai/index.html\">词牌名</a></li>\n",
      "                    <li><a href=\"/cangtoushi/index.html\">藏头诗</a></li>\n",
      "                    <li><a href=\"/hecheng/index.html\">合称</a></li>\n",
      "                    <li><a href=\"/book/\">古籍</a></li>\n",
      "\t\t    <li><a href=\"/app/\">安卓下载</a></li>\n",
      "                </ul>\n",
      "            </div>\n",
      "            <div style=\"clear: both\"></div>\n",
      "        </div>\n",
      "        <div id=\"top_right\">\n",
      "            <div id=\"top_right_nav\">\n",
      "                <ul>\n",
      "                    <li><a href=\"javascript:void(0)\" data-cate=\"all\">综合</a> </li>\n",
      "                    <li><a href=\"javascript:void(0)\" data-cate=\"zuozhe\">作者</a> </li>\n",
      "                    <li><a href=\"javascript:void(0)\" data-cate=\"title\">标题</a> </li>\n",
      "                    <li><a href=\"javascript:void(0)\" data-cate=\"shiju\">诗句</a> </li>\n",
      "                    <li><a href=\"javascript:void(0)\" data-cate=\"first\">句首</a> </li>\n",
      "                    <li><a href=\"javascript:void(0)\" data-cate=\"end\">句尾</a> </li>\n",
      "                    <li><a href=\"javascript:void(0)\" data-cate=\"book\">古籍</a> </li>\n",
      "                    <li><a href=\"javascript:void(0)\" data-cate=\"chengyu\">成语</a> </li>\n",
      "                </ul>\n",
      "            </div>\n",
      "            <div id=\"input_div\">\n",
      "                <input type=\"text\" name=\"kw\" id=\"search_input\" placeholder=\"\" autocomplete=\"off\" value=\"\">\n",
      "                <a href=\"javascript:doSearch();\"><img src=\"/public/image/web_search.png\" class=\"www-icon\"></a>\n",
      "                <div style=\"clear: both\"></div>\n",
      "            </div>\n",
      "            <div id=\"tip_result\" class=\"card\">\n",
      "                <ul>\n",
      "                </ul>\n",
      "                <div id=\"tip_content\">\n",
      "                </div>\n",
      "            </div>\n",
      "        </div>\n",
      "        <div style=\"clear: both;\"></div>\n",
      "    </div>\n",
      "</div>\n",
      "\n",
      "<div id=\"nav-top\"><a href=\"/\">主页</a><span class=\"nav-arrow\"></span><a href=\"/book/index.html\">史书典籍</a><span class=\"nav-arrow\"></span><a href=\"/book/huqianjing.html\">虎钤经</a></div>\n",
      "\n",
      "<div id=\"main\">\n",
      "    <div id=\"main_left\">\n",
      "        <div class=\"card bookmark-list\">\n",
      "            <h1>卷一</h1>\n",
      "            <div class=\"chapter_content\">\n",
      "                　　天功第一　　天道变化，消长万汇，契地之力，乃有成尔。天贵而地贱，天动而地静，贵者运机而贱者效力。上有其动，而下行其地矣。是以知天之施地匪专也，知地之应天有常也。生机动则应之以生，气机动则应之以气。机正则泰，机乱则否。万物列形而否泰交著，见之于地焉，岂止地之为乎？盖天道内而地道外者也。王者，天也；将，地也。将者，天也；士卒，地也。我，天也；敌，地也。由此观其所动，故负胜可知矣。王之於将也，阃外之寄，择贤授柄，举无所疑。将必内应其正，外务其顺。应以正则师律严，务以顺则臣节贞。举而御敌，讵有舆尸之患乎？君恃智以自用，倨礼而傲下，授柄匪人，任人不信，将不正应，内包犹豫之惑，外丧驭众之威矣。举而御敌，宁免失律之凶乎？师之成败见之於将焉，岂将之为乎？将之为任也，智敌万人，苟无万人之用，与愚者同矣；勇冠三军，苟无三军之用，与懦者同矣。善为将者正而能变，刚而能恤，仁而能断，勇而能详，以策驭吏士，未有不振拔勋业，以戡祸乱者也。反是，则吏士外无攻，内多离散之势。勇怯见之吏士焉，岂吏士之为乎？我之於敌也，夫功拔战胜，使敌不敢抗衡者，岂敌怯乎？由我威令整，进退肃，赏罚明也。覆兵杀将，弱国削地者，岂敌强威乎？由我不严师律故也。夫如是，亦自上而及下，自内而迨外，其犹天地之用乎。故天必藉地力，然后运四气，正生杀也；贵必藉贱力，然后能立元功而建王业也。　　地利第二<br><br>　　地之形，险易殊也；地之气，寒热异也。用形与气，在知逆顺焉。昧此道者，不能得地利必矣。善用地者则不然，险而易之，易而险之也。夫居险用险必内溃，居易用易必内蹶。当有形之用，逆之者善矣。何谓险而易之？曰：简以夷其政，要以节其动，用以缓其约，不以疏慢为失也。何谓易而险之？曰：进止戒严，内外无怠，用其谨慎，不以暴急为务也。如是者，乃险易之用也。以方位观之，则寒热之气异也。当有气之用，顺之者善矣。南方之气热，北方之气寒也。其气异则水土之性必相戾，逆诸人而使之饮其地脉，食其土毛，蒙其风气，瘴疠之疾、冻涩之戾加焉。以我之不便，犯顺方之人，不有患乎？天不能以气顺人，君能以人顺气，可也。是故利不可以专一。北人之马，南人之航也，各有便焉。反是，不可措手足矣。行师者不能择而用之，斯亦更北南之所便也。冀其成功，远矣。是知地之所利者，可兼而有乎。善用兵者，择利而从之，善矣。　　人用第三<br><br>　　今之世取人也，每务其多学而舍其偏技，非良术也。兵家所利，随其长短而用之也。是以善抚恤者勿频斗，虑其劳疲而无勇也；善保守者勿使进攻，虑其迟缓而不猛也；多方者勿使与於决事，虑其犹豫也；多勇者勿与谋敌，虑其过轻也。精悍者使斗；果敢者使攻也；沉毅而性执者，使其据阻险；见小而贪财者，不可使守储蓄；智而善断者，可择其言；轻健者使诱敌；刚愎者使当锋；利口喋喋者使行问；善鼠窃狗偷者使盗号探敌；恶言多骂者使之扬毁訾詈；奇材异识者使预谈论；深识大度者使安众；崛强多力者使斩辟榛莽；善随地形结构者使度树营栅；怯懦者使辇运器用；老弱者使备炊汲；谙山川、择高下水泉之利者，使察地形；妖言诈辞、善张皇鬼神之心、推引天命者，使扬声惑众以动敌心；善择地势平易险阻，知往来细大之蹊路者，使通粮储；奇辞伟辨、能架虚矜大者，使奋振威德；耳目聪明、探察敌人情者，使伺候奸伪；敏才健笔者，使主笺檄。明七曜休咎者，为历数之士；善占风云吉凶者，为候气之士；晓六壬遁甲者，为选日时之士；谙蓍龟者，为卜筮之士。是四人者，虽推验体测阴阳，各不可使相乱，贵其专一也。医药之人，二十人已上，以兵数增之。兽医亦如医人之数。大将军权通材者，与之参议可否。故我大众之内有善有恶，无弃人焉。人无所弃，斯不怨则动有功矣。<br><br>　　三才应变第四　　《易》曰：见机而作，不俟终日。故用兵之术，知变为大。军虽气锐时胜（一作遇天时），而行列散溃，旌旗紊乱，金鼓不节，击之可也。或曰：彼得天时，讵可破乎？许洞曰：天之所，正也。怙天时而戾军政，与天违也。天人相违，不凶何俟？故兵利以顺应顺也。顺而逆应之，必凶之兆也。或曰：军乘天时，跨有地利，将吏骄怠，谋划不精，军阵散乱，如之何？洞曰：可击也。彼获天地之利，如何击之？曰：人者，天地之心也，苟心不正，虽有其表，将焉用乎？或曰：军违天时、逆地利，大将深谋沉毅，部伍清肃，进退有节，如之何？许洞曰：未可击也。曰：不获天地之利，奚谓未可乎？曰：正则可以率天地之用，草寇可为王矣。或曰：彼如是也，我之动将之如何？许洞曰：先以人，次以地，次以天，然后攻之，必克敌也。曰：先后如之何？曰：利为主。何谓主？曰：动为客，静为主。观敌之动何如，乃应之（夫书言动者，不必战阵时，敌人先动为客也。但密构敌人所为之事谓之动，则我以机应之必胜焉）。先胜而后举，神明之道也。<br><br>　　三才随用第五<br><br>　　天著吉凶，以阴阳辨也；地布险易，以山川章也；人包勇怯，以战阵见也。苟（一作有）欲阴阳之顺，险易之利，勇怯之用，在於闲暇可得而择也。当彼我相逢，各出不意，忽然交合，曷能择所利而用哉？或曰：两师不期逼於险地，天地震晦，雨雪交积，山川不辨，当此之际，何以御之？许洞曰：大将止众坚阵，严肃号令，虽敌来攻，勿与交战。俟天变少罢，观弱强之势，而后进退之。曰：我既安矣，彼自惊挠，则如之何？曰：以积兵乘之。又曰：仓卒之际，大将以何术即能坚行阵、严号令，使士卒不自惊乱？许洞曰：善用兵者，有动必备。预择轻勇者二十四人，八方各三骑，相去一里，昼以旗，夜以鼓（过山川委曲，丛林茂密，昼亦鸣鼓，恐不见旗）。第一骑见贼昼举旗，第二骑亦如之，第三骑驰告。夜用鼓，如昼法（恐敌闻鼓声急驰告）。烟雾蓊塞，风雷震惊，旗之不见，鼓之不闻，亟驰告。斯谓八卦探骑者也。是以值贼而能备焉。苟天地有变，则引轻兵突之。大阵不可妄动（凡大兵出，常以轻骑数千人别分部队为游兵，其将择骁勇），观彼动静而后举焉，故我常用其整也。此皆随天之变也。或曰：与敌卒然相遇，或平原广泽，或山谷深峭，或坡嶝穹隆，或坳污沮洳，或草木蒙密，俱是危地，当其用之如何？许洞曰：回渠迂涧，可以冲车突驰也；深峡隘口，可以少击众也；长林丰草，可以为伏也；原野漫衍，可以骑兵相属也；草木隐障，可以步士接战；长郊往来，可进可退，可以长戟当敌；逾水跨远，高下相乘，不可得亲近，可以长弩当敌；崖壁相隐，狭径斗回，可以剑盾当敌；苇萧芦荻，枝叶朦胧，可以戈梃当敌。此皆随地之性也。或曰：寨栅之间，三军已憩，寇敌乘间冲突攻击，当此之时如之何？许洞曰：使勇者据其前，怯者匿其后。忽遽之时，怯者强驱而前进焉，必挫锋折锐，不若隐之也。曰：当此之时，何暇别勇怯之用乎？曰：不然。善用兵者，防乱於未乱，备急於未急。结营既定，预择强勇者卫外，怯弱者附之，所以虑晦夜之急也。此皆随人之性也。如是，顺天、地、人预备之道者也。故易之卦以豫者预也，取预备之象为难之用也。故曰：重门击柝，以待暴客，盖取诸豫。用兵者可不审於此乎？\n",
      "                    </div>\n",
      "        </div>\n",
      "        <div class=\"book-page-nav\">\n",
      "                        <a href=\"/book/huqianjing.html\"><span>回目录</span></a>\n",
      "                        <a href=\"/book/huqianjing/2.html\"><span>下一章</span></a>\n",
      "                    </div>\n",
      "    </div>\n",
      "    <div  id=\"main_right\">\n",
      "        \n",
      "        \t<div class=\"card right-book-card\">\n",
      "\t\t<div class=\"aside_title\">推荐阅读</div>\n",
      "\t\t\t<h6>四大名著</h6>\n",
      "\t\t\t<div>\n",
      "\t\t\t<ul>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/sanguoyanyi.html\">《三国演义》</a></li>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/shuihuzhuan.html\">《水浒传》</a></li>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/xiyouji.html\">《西游记》</a></li>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/hongloumeng.html\">《红楼梦》</a></li>\n",
      "\t\t\t\t\t\t\t\t<div style=\"clear: both\"></div>\n",
      "\t\t\t</ul>\n",
      "\t\t</div>\n",
      "\t\t\t\t<h6>二十四史</h6>\n",
      "\t\t\t<div>\n",
      "\t\t\t<ul>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/shiji.html\">《史记》</a></li>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/hanshu.html\">《汉书》</a></li>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/houhanshu.html\">《后汉书》</a></li>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/sanguozhi.html\">《三国志》</a></li>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/jinshu.html\">《晋书》</a></li>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/songshu.html\">《宋书》</a></li>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/nanqishu.html\">《南齐书》</a></li>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/liangshu.html\">《梁书》</a></li>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/chenshu.html\">《陈书》</a></li>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/weishu.html\">《魏书》</a></li>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/beiqishu.html\">《北齐书》</a></li>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/zhoushu.html\">《周书》</a></li>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/suishu.html\">《隋书》</a></li>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/nanshi.html\">《南史》</a></li>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/beishi.html\">《北史》</a></li>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/jiutangshu.html\">《旧唐书》</a></li>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/xintangshu.html\">《新唐书》</a></li>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/jiuwudaishi.html\">《旧五代史》</a></li>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/xinwudaishi.html\">《新五代史》</a></li>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/songshi.html\">《宋史》</a></li>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/liaoshi.html\">《辽史》</a></li>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/jinshi.html\">《金史》</a></li>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/yuanshi.html\">《元史》</a></li>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/mingshi.html\">《明史》</a></li>\n",
      "\t\t\t\t\t\t\t\t<div style=\"clear: both\"></div>\n",
      "\t\t\t</ul>\n",
      "\t\t</div>\n",
      "\t\t\t\t<h6>四书</h6>\n",
      "\t\t\t<div>\n",
      "\t\t\t<ul>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/lunyu.html\">《论语》</a></li>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/mengzi.html\">《孟子》</a></li>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/daxue.html\">《大学》</a></li>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/zhongyong.html\">《中庸》</a></li>\n",
      "\t\t\t\t\t\t\t\t<div style=\"clear: both\"></div>\n",
      "\t\t\t</ul>\n",
      "\t\t</div>\n",
      "\t\t\t\t<h6>五经</h6>\n",
      "\t\t\t<div>\n",
      "\t\t\t<ul>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/shangshu.html\">《尚书》</a></li>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/liji.html\">《礼记》</a></li>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/zhouyi.html\">《周易》</a></li>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/chunqiuzuozhuan.html\">《春秋左氏传》</a></li>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/shijing.html\">《诗经》</a></li>\n",
      "\t\t\t\t\t\t\t\t<div style=\"clear: both\"></div>\n",
      "\t\t\t</ul>\n",
      "\t\t</div>\n",
      "\t\t\t\t<h6>演义小说</h6>\n",
      "\t\t\t<div>\n",
      "\t\t\t<ul>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/sanguoyanyi.html\">《三国演义》</a></li>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/suitangyanyi.html\">《隋唐演义》</a></li>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/dongzhoulieguozhi.html\">《东周列国志》</a></li>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/yangjiajiang.html\">《杨家将》</a></li>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/qianhanyanyi.html\">《前汉演义》</a></li>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/houhanyanyi.html\">《后汉演义》</a></li>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/liangjinyanyi.html\">《两晋演义》</a></li>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/nanbeishiyanyi.html\">《南北史演义》</a></li>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/cantangwudaishiyanyi.html\">《残唐五代史演义》</a></li>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/suitangliangchaozhizhuan.html\">《隋唐两朝志传》</a></li>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/yuanshiyanyi.html\">《元史演义》</a></li>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/mingshiyanyi.html\">《明史演义》</a></li>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/qingshiyanyi.html\">《清史演义》</a></li>\n",
      "\t\t\t\t\t\t\t\t<li><a href=\"/book/minguoyanyi.html\">《民国演义》</a></li>\n",
      "\t\t\t\t\t\t\t\t<div style=\"clear: both\"></div>\n",
      "\t\t\t</ul>\n",
      "\t\t</div>\n",
      "\t\t\t</div>\n",
      "\n",
      "        \n",
      "    </div>\n",
      "    <div style=\"clear: both;\"></div>\n",
      "</div><a href=\"javascript:toTop();\"><div id=\"toTop\">顶部</div></a>\n",
      "<div id=\"footer\">\n",
      "    <div id=\"footer_main\">\n",
      "        <div id=\"bottom_nav\">\n",
      "            <a href=\"/category/story\">诗人故事</a>\n",
      "            <a href=\"/category/xiehouyu\">歇后语</a>\n",
      "            <a href=\"/category/miyu\">谜语</a>\n",
      "            <a href=\"/category/duilian\">对联</a>\n",
      "                        Copyright © 2010-2020 <a href=\"https://beian.miit.gov.cn/#/Integrated/index\" target=\"_blank\">京ICP备2021022011号-1</a> \n",
      "                    </div>\n",
      "    </div>\n",
      "</div>\n",
      "\n",
      "<script>\n",
      "var _hmt = _hmt || [];\n",
      "(function() {\n",
      "  var hm = document.createElement(\"script\");\n",
      "  hm.src = \"https://hm.baidu.com/hm.js?649f268280b553df1f778477ee743752\";\n",
      "  var s = document.getElementsByTagName(\"script\")[0];\n",
      "  s.parentNode.insertBefore(hm, s);\n",
      "})();\n",
      "</script>\n",
      "\n",
      "</body>\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "</html>\n"
     ]
    }
   ],
   "source": [
    "import requests\n",
    "\n",
    "i=1\n",
    "url='https://www.shicimingju.com/book/hongloumeng/{}.html'.format(i)\n",
    "print(url)\n",
    "\n",
    "headers={'user-agent':'Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.74 Mobile Safari/537.36'}\n",
    "\n",
    "html=requests.get(url=url,headers=headers).content.decode('utf-8')\n",
    "\n",
    "print(html)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 64,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<!DOCTYPE html>\n",
      "<html lang=\"zh\">\n",
      " <head>\n",
      "  <script src=\"https://ip.ws.126.net/ipquery\" type=\"text/javascript\">\n",
      "  </script>\n",
      "  <script src=\"/newpage/js/all.js\">\n",
      "  </script>\n",
      "  <meta charset=\"utf-8\"/>\n",
      "  <title>\n",
      "   卷一_《虎钤经》_诗词名句网\n",
      "  </title>\n",
      "  <meta content=\"width=device-width,user-scalable=no\" name=\"viewport\"/>\n",
      "  <meta content=\"\" name=\"description\"/>\n",
      "  <link href=\"/public/css/www_v3.css\" rel=\"stylesheet\"/>\n",
      "  <link href=\"/public/css/font_576092_m2icqcebp7evzpvi.css\" rel=\"stylesheet\"/>\n",
      "  <script src=\"/public/js/device.js\">\n",
      "  </script>\n",
      "  <script src=\"/public/js/jq.js\">\n",
      "  </script>\n",
      "  <script src=\"/public/js/www_v3.js\">\n",
      "  </script>\n",
      " </head>\n",
      " <body>\n",
      "  <div id=\"top_bar\">\n",
      "   <div id=\"top_bar_main\">\n",
      "    <div id=\"top_left\">\n",
      "     <a href=\"/\">\n",
      "      <img id=\"logo\" src=\"/public/image/logo.png\"/>\n",
      "     </a>\n",
      "     <div id=\"top_left_menu\">\n",
      "      <ul>\n",
      "       <li>\n",
      "        <a href=\"/\">\n",
      "         首页\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/shicimark\">\n",
      "         分类\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/category/all\">\n",
      "         作者\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/paiming\">\n",
      "         排行榜\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/cate?cate_id=4\">\n",
      "         课本古诗\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/cipai/index.html\">\n",
      "         词牌名\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/cangtoushi/index.html\">\n",
      "         藏头诗\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/hecheng/index.html\">\n",
      "         合称\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/\">\n",
      "         古籍\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/app/\">\n",
      "         安卓下载\n",
      "        </a>\n",
      "       </li>\n",
      "      </ul>\n",
      "     </div>\n",
      "     <div style=\"clear: both\">\n",
      "     </div>\n",
      "    </div>\n",
      "    <div id=\"top_right\">\n",
      "     <div id=\"top_right_nav\">\n",
      "      <ul>\n",
      "       <li>\n",
      "        <a data-cate=\"all\" href=\"javascript:void(0)\">\n",
      "         综合\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a data-cate=\"zuozhe\" href=\"javascript:void(0)\">\n",
      "         作者\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a data-cate=\"title\" href=\"javascript:void(0)\">\n",
      "         标题\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a data-cate=\"shiju\" href=\"javascript:void(0)\">\n",
      "         诗句\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a data-cate=\"first\" href=\"javascript:void(0)\">\n",
      "         句首\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a data-cate=\"end\" href=\"javascript:void(0)\">\n",
      "         句尾\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a data-cate=\"book\" href=\"javascript:void(0)\">\n",
      "         古籍\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a data-cate=\"chengyu\" href=\"javascript:void(0)\">\n",
      "         成语\n",
      "        </a>\n",
      "       </li>\n",
      "      </ul>\n",
      "     </div>\n",
      "     <div id=\"input_div\">\n",
      "      <input autocomplete=\"off\" id=\"search_input\" name=\"kw\" placeholder=\"\" type=\"text\" value=\"\"/>\n",
      "      <a href=\"javascript:doSearch();\">\n",
      "       <img class=\"www-icon\" src=\"/public/image/web_search.png\"/>\n",
      "      </a>\n",
      "      <div style=\"clear: both\">\n",
      "      </div>\n",
      "     </div>\n",
      "     <div class=\"card\" id=\"tip_result\">\n",
      "      <ul>\n",
      "      </ul>\n",
      "      <div id=\"tip_content\">\n",
      "      </div>\n",
      "     </div>\n",
      "    </div>\n",
      "    <div style=\"clear: both;\">\n",
      "    </div>\n",
      "   </div>\n",
      "  </div>\n",
      "  <div id=\"nav-top\">\n",
      "   <a href=\"/\">\n",
      "    主页\n",
      "   </a>\n",
      "   <span class=\"nav-arrow\">\n",
      "   </span>\n",
      "   <a href=\"/book/index.html\">\n",
      "    史书典籍\n",
      "   </a>\n",
      "   <span class=\"nav-arrow\">\n",
      "   </span>\n",
      "   <a href=\"/book/huqianjing.html\">\n",
      "    虎钤经\n",
      "   </a>\n",
      "  </div>\n",
      "  <div id=\"main\">\n",
      "   <div id=\"main_left\">\n",
      "    <div class=\"card bookmark-list\">\n",
      "     <h1>\n",
      "      卷一\n",
      "     </h1>\n",
      "     <div class=\"chapter_content\">\n",
      "      天功第一　　天道变化，消长万汇，契地之力，乃有成尔。天贵而地贱，天动而地静，贵者运机而贱者效力。上有其动，而下行其地矣。是以知天之施地匪专也，知地之应天有常也。生机动则应之以生，气机动则应之以气。机正则泰，机乱则否。万物列形而否泰交著，见之于地焉，岂止地之为乎？盖天道内而地道外者也。王者，天也；将，地也。将者，天也；士卒，地也。我，天也；敌，地也。由此观其所动，故负胜可知矣。王之於将也，阃外之寄，择贤授柄，举无所疑。将必内应其正，外务其顺。应以正则师律严，务以顺则臣节贞。举而御敌，讵有舆尸之患乎？君恃智以自用，倨礼而傲下，授柄匪人，任人不信，将不正应，内包犹豫之惑，外丧驭众之威矣。举而御敌，宁免失律之凶乎？师之成败见之於将焉，岂将之为乎？将之为任也，智敌万人，苟无万人之用，与愚者同矣；勇冠三军，苟无三军之用，与懦者同矣。善为将者正而能变，刚而能恤，仁而能断，勇而能详，以策驭吏士，未有不振拔勋业，以戡祸乱者也。反是，则吏士外无攻，内多离散之势。勇怯见之吏士焉，岂吏士之为乎？我之於敌也，夫功拔战胜，使敌不敢抗衡者，岂敌怯乎？由我威令整，进退肃，赏罚明也。覆兵杀将，弱国削地者，岂敌强威乎？由我不严师律故也。夫如是，亦自上而及下，自内而迨外，其犹天地之用乎。故天必藉地力，然后运四气，正生杀也；贵必藉贱力，然后能立元功而建王业也。　　地利第二\n",
      "      <br/>\n",
      "      <br/>\n",
      "      地之形，险易殊也；地之气，寒热异也。用形与气，在知逆顺焉。昧此道者，不能得地利必矣。善用地者则不然，险而易之，易而险之也。夫居险用险必内溃，居易用易必内蹶。当有形之用，逆之者善矣。何谓险而易之？曰：简以夷其政，要以节其动，用以缓其约，不以疏慢为失也。何谓易而险之？曰：进止戒严，内外无怠，用其谨慎，不以暴急为务也。如是者，乃险易之用也。以方位观之，则寒热之气异也。当有气之用，顺之者善矣。南方之气热，北方之气寒也。其气异则水土之性必相戾，逆诸人而使之饮其地脉，食其土毛，蒙其风气，瘴疠之疾、冻涩之戾加焉。以我之不便，犯顺方之人，不有患乎？天不能以气顺人，君能以人顺气，可也。是故利不可以专一。北人之马，南人之航也，各有便焉。反是，不可措手足矣。行师者不能择而用之，斯亦更北南之所便也。冀其成功，远矣。是知地之所利者，可兼而有乎。善用兵者，择利而从之，善矣。　　人用第三\n",
      "      <br/>\n",
      "      <br/>\n",
      "      今之世取人也，每务其多学而舍其偏技，非良术也。兵家所利，随其长短而用之也。是以善抚恤者勿频斗，虑其劳疲而无勇也；善保守者勿使进攻，虑其迟缓而不猛也；多方者勿使与於决事，虑其犹豫也；多勇者勿与谋敌，虑其过轻也。精悍者使斗；果敢者使攻也；沉毅而性执者，使其据阻险；见小而贪财者，不可使守储蓄；智而善断者，可择其言；轻健者使诱敌；刚愎者使当锋；利口喋喋者使行问；善鼠窃狗偷者使盗号探敌；恶言多骂者使之扬毁訾詈；奇材异识者使预谈论；深识大度者使安众；崛强多力者使斩辟榛莽；善随地形结构者使度树营栅；怯懦者使辇运器用；老弱者使备炊汲；谙山川、择高下水泉之利者，使察地形；妖言诈辞、善张皇鬼神之心、推引天命者，使扬声惑众以动敌心；善择地势平易险阻，知往来细大之蹊路者，使通粮储；奇辞伟辨、能架虚矜大者，使奋振威德；耳目聪明、探察敌人情者，使伺候奸伪；敏才健笔者，使主笺檄。明七曜休咎者，为历数之士；善占风云吉凶者，为候气之士；晓六壬遁甲者，为选日时之士；谙蓍龟者，为卜筮之士。是四人者，虽推验体测阴阳，各不可使相乱，贵其专一也。医药之人，二十人已上，以兵数增之。兽医亦如医人之数。大将军权通材者，与之参议可否。故我大众之内有善有恶，无弃人焉。人无所弃，斯不怨则动有功矣。\n",
      "      <br/>\n",
      "      <br/>\n",
      "      三才应变第四　　《易》曰：见机而作，不俟终日。故用兵之术，知变为大。军虽气锐时胜（一作遇天时），而行列散溃，旌旗紊乱，金鼓不节，击之可也。或曰：彼得天时，讵可破乎？许洞曰：天之所，正也。怙天时而戾军政，与天违也。天人相违，不凶何俟？故兵利以顺应顺也。顺而逆应之，必凶之兆也。或曰：军乘天时，跨有地利，将吏骄怠，谋划不精，军阵散乱，如之何？洞曰：可击也。彼获天地之利，如何击之？曰：人者，天地之心也，苟心不正，虽有其表，将焉用乎？或曰：军违天时、逆地利，大将深谋沉毅，部伍清肃，进退有节，如之何？许洞曰：未可击也。曰：不获天地之利，奚谓未可乎？曰：正则可以率天地之用，草寇可为王矣。或曰：彼如是也，我之动将之如何？许洞曰：先以人，次以地，次以天，然后攻之，必克敌也。曰：先后如之何？曰：利为主。何谓主？曰：动为客，静为主。观敌之动何如，乃应之（夫书言动者，不必战阵时，敌人先动为客也。但密构敌人所为之事谓之动，则我以机应之必胜焉）。先胜而后举，神明之道也。\n",
      "      <br/>\n",
      "      <br/>\n",
      "      三才随用第五\n",
      "      <br/>\n",
      "      <br/>\n",
      "      天著吉凶，以阴阳辨也；地布险易，以山川章也；人包勇怯，以战阵见也。苟（一作有）欲阴阳之顺，险易之利，勇怯之用，在於闲暇可得而择也。当彼我相逢，各出不意，忽然交合，曷能择所利而用哉？或曰：两师不期逼於险地，天地震晦，雨雪交积，山川不辨，当此之际，何以御之？许洞曰：大将止众坚阵，严肃号令，虽敌来攻，勿与交战。俟天变少罢，观弱强之势，而后进退之。曰：我既安矣，彼自惊挠，则如之何？曰：以积兵乘之。又曰：仓卒之际，大将以何术即能坚行阵、严号令，使士卒不自惊乱？许洞曰：善用兵者，有动必备。预择轻勇者二十四人，八方各三骑，相去一里，昼以旗，夜以鼓（过山川委曲，丛林茂密，昼亦鸣鼓，恐不见旗）。第一骑见贼昼举旗，第二骑亦如之，第三骑驰告。夜用鼓，如昼法（恐敌闻鼓声急驰告）。烟雾蓊塞，风雷震惊，旗之不见，鼓之不闻，亟驰告。斯谓八卦探骑者也。是以值贼而能备焉。苟天地有变，则引轻兵突之。大阵不可妄动（凡大兵出，常以轻骑数千人别分部队为游兵，其将择骁勇），观彼动静而后举焉，故我常用其整也。此皆随天之变也。或曰：与敌卒然相遇，或平原广泽，或山谷深峭，或坡嶝穹隆，或坳污沮洳，或草木蒙密，俱是危地，当其用之如何？许洞曰：回渠迂涧，可以冲车突驰也；深峡隘口，可以少击众也；长林丰草，可以为伏也；原野漫衍，可以骑兵相属也；草木隐障，可以步士接战；长郊往来，可进可退，可以长戟当敌；逾水跨远，高下相乘，不可得亲近，可以长弩当敌；崖壁相隐，狭径斗回，可以剑盾当敌；苇萧芦荻，枝叶朦胧，可以戈梃当敌。此皆随地之性也。或曰：寨栅之间，三军已憩，寇敌乘间冲突攻击，当此之时如之何？许洞曰：使勇者据其前，怯者匿其后。忽遽之时，怯者强驱而前进焉，必挫锋折锐，不若隐之也。曰：当此之时，何暇别勇怯之用乎？曰：不然。善用兵者，防乱於未乱，备急於未急。结营既定，预择强勇者卫外，怯弱者附之，所以虑晦夜之急也。此皆随人之性也。如是，顺天、地、人预备之道者也。故易之卦以豫者预也，取预备之象为难之用也。故曰：重门击柝，以待暴客，盖取诸豫。用兵者可不审於此乎？\n",
      "     </div>\n",
      "    </div>\n",
      "    <div class=\"book-page-nav\">\n",
      "     <a href=\"/book/huqianjing.html\">\n",
      "      <span>\n",
      "       回目录\n",
      "      </span>\n",
      "     </a>\n",
      "     <a href=\"/book/huqianjing/2.html\">\n",
      "      <span>\n",
      "       下一章\n",
      "      </span>\n",
      "     </a>\n",
      "    </div>\n",
      "   </div>\n",
      "   <div id=\"main_right\">\n",
      "    <div class=\"card right-book-card\">\n",
      "     <div class=\"aside_title\">\n",
      "      推荐阅读\n",
      "     </div>\n",
      "     <h6>\n",
      "      四大名著\n",
      "     </h6>\n",
      "     <div>\n",
      "      <ul>\n",
      "       <li>\n",
      "        <a href=\"/book/sanguoyanyi.html\">\n",
      "         《三国演义》\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/shuihuzhuan.html\">\n",
      "         《水浒传》\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/xiyouji.html\">\n",
      "         《西游记》\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hongloumeng.html\">\n",
      "         《红楼梦》\n",
      "        </a>\n",
      "       </li>\n",
      "       <div style=\"clear: both\">\n",
      "       </div>\n",
      "      </ul>\n",
      "     </div>\n",
      "     <h6>\n",
      "      二十四史\n",
      "     </h6>\n",
      "     <div>\n",
      "      <ul>\n",
      "       <li>\n",
      "        <a href=\"/book/shiji.html\">\n",
      "         《史记》\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/hanshu.html\">\n",
      "         《汉书》\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/houhanshu.html\">\n",
      "         《后汉书》\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/sanguozhi.html\">\n",
      "         《三国志》\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/jinshu.html\">\n",
      "         《晋书》\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/songshu.html\">\n",
      "         《宋书》\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/nanqishu.html\">\n",
      "         《南齐书》\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/liangshu.html\">\n",
      "         《梁书》\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/chenshu.html\">\n",
      "         《陈书》\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/weishu.html\">\n",
      "         《魏书》\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/beiqishu.html\">\n",
      "         《北齐书》\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/zhoushu.html\">\n",
      "         《周书》\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/suishu.html\">\n",
      "         《隋书》\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/nanshi.html\">\n",
      "         《南史》\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/beishi.html\">\n",
      "         《北史》\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/jiutangshu.html\">\n",
      "         《旧唐书》\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/xintangshu.html\">\n",
      "         《新唐书》\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/jiuwudaishi.html\">\n",
      "         《旧五代史》\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/xinwudaishi.html\">\n",
      "         《新五代史》\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/songshi.html\">\n",
      "         《宋史》\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/liaoshi.html\">\n",
      "         《辽史》\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/jinshi.html\">\n",
      "         《金史》\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/yuanshi.html\">\n",
      "         《元史》\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/mingshi.html\">\n",
      "         《明史》\n",
      "        </a>\n",
      "       </li>\n",
      "       <div style=\"clear: both\">\n",
      "       </div>\n",
      "      </ul>\n",
      "     </div>\n",
      "     <h6>\n",
      "      四书\n",
      "     </h6>\n",
      "     <div>\n",
      "      <ul>\n",
      "       <li>\n",
      "        <a href=\"/book/lunyu.html\">\n",
      "         《论语》\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/mengzi.html\">\n",
      "         《孟子》\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/daxue.html\">\n",
      "         《大学》\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/zhongyong.html\">\n",
      "         《中庸》\n",
      "        </a>\n",
      "       </li>\n",
      "       <div style=\"clear: both\">\n",
      "       </div>\n",
      "      </ul>\n",
      "     </div>\n",
      "     <h6>\n",
      "      五经\n",
      "     </h6>\n",
      "     <div>\n",
      "      <ul>\n",
      "       <li>\n",
      "        <a href=\"/book/shangshu.html\">\n",
      "         《尚书》\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/liji.html\">\n",
      "         《礼记》\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/zhouyi.html\">\n",
      "         《周易》\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/chunqiuzuozhuan.html\">\n",
      "         《春秋左氏传》\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/shijing.html\">\n",
      "         《诗经》\n",
      "        </a>\n",
      "       </li>\n",
      "       <div style=\"clear: both\">\n",
      "       </div>\n",
      "      </ul>\n",
      "     </div>\n",
      "     <h6>\n",
      "      演义小说\n",
      "     </h6>\n",
      "     <div>\n",
      "      <ul>\n",
      "       <li>\n",
      "        <a href=\"/book/sanguoyanyi.html\">\n",
      "         《三国演义》\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/suitangyanyi.html\">\n",
      "         《隋唐演义》\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/dongzhoulieguozhi.html\">\n",
      "         《东周列国志》\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/yangjiajiang.html\">\n",
      "         《杨家将》\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/qianhanyanyi.html\">\n",
      "         《前汉演义》\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/houhanyanyi.html\">\n",
      "         《后汉演义》\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/liangjinyanyi.html\">\n",
      "         《两晋演义》\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/nanbeishiyanyi.html\">\n",
      "         《南北史演义》\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/cantangwudaishiyanyi.html\">\n",
      "         《残唐五代史演义》\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/suitangliangchaozhizhuan.html\">\n",
      "         《隋唐两朝志传》\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/yuanshiyanyi.html\">\n",
      "         《元史演义》\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/mingshiyanyi.html\">\n",
      "         《明史演义》\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/qingshiyanyi.html\">\n",
      "         《清史演义》\n",
      "        </a>\n",
      "       </li>\n",
      "       <li>\n",
      "        <a href=\"/book/minguoyanyi.html\">\n",
      "         《民国演义》\n",
      "        </a>\n",
      "       </li>\n",
      "       <div style=\"clear: both\">\n",
      "       </div>\n",
      "      </ul>\n",
      "     </div>\n",
      "    </div>\n",
      "   </div>\n",
      "   <div style=\"clear: both;\">\n",
      "   </div>\n",
      "  </div>\n",
      "  <a href=\"javascript:toTop();\">\n",
      "   <div id=\"toTop\">\n",
      "    顶部\n",
      "   </div>\n",
      "  </a>\n",
      "  <div id=\"footer\">\n",
      "   <div id=\"footer_main\">\n",
      "    <div id=\"bottom_nav\">\n",
      "     <a href=\"/category/story\">\n",
      "      诗人故事\n",
      "     </a>\n",
      "     <a href=\"/category/xiehouyu\">\n",
      "      歇后语\n",
      "     </a>\n",
      "     <a href=\"/category/miyu\">\n",
      "      谜语\n",
      "     </a>\n",
      "     <a href=\"/category/duilian\">\n",
      "      对联\n",
      "     </a>\n",
      "     Copyright © 2010-2020\n",
      "     <a href=\"https://beian.miit.gov.cn/#/Integrated/index\" target=\"_blank\">\n",
      "      京ICP备2021022011号-1\n",
      "     </a>\n",
      "    </div>\n",
      "   </div>\n",
      "  </div>\n",
      "  <script>\n",
      "   var _hmt = _hmt || [];\n",
      "(function() {\n",
      "  var hm = document.createElement(\"script\");\n",
      "  hm.src = \"https://hm.baidu.com/hm.js?649f268280b553df1f778477ee743752\";\n",
      "  var s = document.getElementsByTagName(\"script\")[0];\n",
      "  s.parentNode.insertBefore(hm, s);\n",
      "})();\n",
      "  </script>\n",
      " </body>\n",
      "</html>\n"
     ]
    }
   ],
   "source": [
    "from bs4 import BeautifulSoup\n",
    "\n",
    "soup = BeautifulSoup(html, 'lxml')\n",
    "\n",
    "print(soup.prettify()) "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 65,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "                　　天功第一　　天道变化，消长万汇，契地之力，乃有成尔。天贵而地贱，天动而地静，贵者运机而贱者效力。上有其动，而下行其地矣。是以知天之施地匪专也，知地之应天有常也。生机动则应之以生，气机动则应之以气。机正则泰，机乱则否。万物列形而否泰交著，见之于地焉，岂止地之为乎？盖天道内而地道外者也。王者，天也；将，地也。将者，天也；士卒，地也。我，天也；敌，地也。由此观其所动，故负胜可知矣。王之於将也，阃外之寄，择贤授柄，举无所疑。将必内应其正，外务其顺。应以正则师律严，务以顺则臣节贞。举而御敌，讵有舆尸之患乎？君恃智以自用，倨礼而傲下，授柄匪人，任人不信，将不正应，内包犹豫之惑，外丧驭众之威矣。举而御敌，宁免失律之凶乎？师之成败见之於将焉，岂将之为乎？将之为任也，智敌万人，苟无万人之用，与愚者同矣；勇冠三军，苟无三军之用，与懦者同矣。善为将者正而能变，刚而能恤，仁而能断，勇而能详，以策驭吏士，未有不振拔勋业，以戡祸乱者也。反是，则吏士外无攻，内多离散之势。勇怯见之吏士焉，岂吏士之为乎？我之於敌也，夫功拔战胜，使敌不敢抗衡者，岂敌怯乎？由我威令整，进退肃，赏罚明也。覆兵杀将，弱国削地者，岂敌强威乎？由我不严师律故也。夫如是，亦自上而及下，自内而迨外，其犹天地之用乎。故天必藉地力，然后运四气，正生杀也；贵必藉贱力，然后能立元功而建王业也。　　地利第二　　地之形，险易殊也；地之气，寒热异也。用形与气，在知逆顺焉。昧此道者，不能得地利必矣。善用地者则不然，险而易之，易而险之也。夫居险用险必内溃，居易用易必内蹶。当有形之用，逆之者善矣。何谓险而易之？曰：简以夷其政，要以节其动，用以缓其约，不以疏慢为失也。何谓易而险之？曰：进止戒严，内外无怠，用其谨慎，不以暴急为务也。如是者，乃险易之用也。以方位观之，则寒热之气异也。当有气之用，顺之者善矣。南方之气热，北方之气寒也。其气异则水土之性必相戾，逆诸人而使之饮其地脉，食其土毛，蒙其风气，瘴疠之疾、冻涩之戾加焉。以我之不便，犯顺方之人，不有患乎？天不能以气顺人，君能以人顺气，可也。是故利不可以专一。北人之马，南人之航也，各有便焉。反是，不可措手足矣。行师者不能择而用之，斯亦更北南之所便也。冀其成功，远矣。是知地之所利者，可兼而有乎。善用兵者，择利而从之，善矣。　　人用第三　　今之世取人也，每务其多学而舍其偏技，非良术也。兵家所利，随其长短而用之也。是以善抚恤者勿频斗，虑其劳疲而无勇也；善保守者勿使进攻，虑其迟缓而不猛也；多方者勿使与於决事，虑其犹豫也；多勇者勿与谋敌，虑其过轻也。精悍者使斗；果敢者使攻也；沉毅而性执者，使其据阻险；见小而贪财者，不可使守储蓄；智而善断者，可择其言；轻健者使诱敌；刚愎者使当锋；利口喋喋者使行问；善鼠窃狗偷者使盗号探敌；恶言多骂者使之扬毁訾詈；奇材异识者使预谈论；深识大度者使安众；崛强多力者使斩辟榛莽；善随地形结构者使度树营栅；怯懦者使辇运器用；老弱者使备炊汲；谙山川、择高下水泉之利者，使察地形；妖言诈辞、善张皇鬼神之心、推引天命者，使扬声惑众以动敌心；善择地势平易险阻，知往来细大之蹊路者，使通粮储；奇辞伟辨、能架虚矜大者，使奋振威德；耳目聪明、探察敌人情者，使伺候奸伪；敏才健笔者，使主笺檄。明七曜休咎者，为历数之士；善占风云吉凶者，为候气之士；晓六壬遁甲者，为选日时之士；谙蓍龟者，为卜筮之士。是四人者，虽推验体测阴阳，各不可使相乱，贵其专一也。医药之人，二十人已上，以兵数增之。兽医亦如医人之数。大将军权通材者，与之参议可否。故我大众之内有善有恶，无弃人焉。人无所弃，斯不怨则动有功矣。　　三才应变第四　　《易》曰：见机而作，不俟终日。故用兵之术，知变为大。军虽气锐时胜（一作遇天时），而行列散溃，旌旗紊乱，金鼓不节，击之可也。或曰：彼得天时，讵可破乎？许洞曰：天之所，正也。怙天时而戾军政，与天违也。天人相违，不凶何俟？故兵利以顺应顺也。顺而逆应之，必凶之兆也。或曰：军乘天时，跨有地利，将吏骄怠，谋划不精，军阵散乱，如之何？洞曰：可击也。彼获天地之利，如何击之？曰：人者，天地之心也，苟心不正，虽有其表，将焉用乎？或曰：军违天时、逆地利，大将深谋沉毅，部伍清肃，进退有节，如之何？许洞曰：未可击也。曰：不获天地之利，奚谓未可乎？曰：正则可以率天地之用，草寇可为王矣。或曰：彼如是也，我之动将之如何？许洞曰：先以人，次以地，次以天，然后攻之，必克敌也。曰：先后如之何？曰：利为主。何谓主？曰：动为客，静为主。观敌之动何如，乃应之（夫书言动者，不必战阵时，敌人先动为客也。但密构敌人所为之事谓之动，则我以机应之必胜焉）。先胜而后举，神明之道也。　　三才随用第五　　天著吉凶，以阴阳辨也；地布险易，以山川章也；人包勇怯，以战阵见也。苟（一作有）欲阴阳之顺，险易之利，勇怯之用，在於闲暇可得而择也。当彼我相逢，各出不意，忽然交合，曷能择所利而用哉？或曰：两师不期逼於险地，天地震晦，雨雪交积，山川不辨，当此之际，何以御之？许洞曰：大将止众坚阵，严肃号令，虽敌来攻，勿与交战。俟天变少罢，观弱强之势，而后进退之。曰：我既安矣，彼自惊挠，则如之何？曰：以积兵乘之。又曰：仓卒之际，大将以何术即能坚行阵、严号令，使士卒不自惊乱？许洞曰：善用兵者，有动必备。预择轻勇者二十四人，八方各三骑，相去一里，昼以旗，夜以鼓（过山川委曲，丛林茂密，昼亦鸣鼓，恐不见旗）。第一骑见贼昼举旗，第二骑亦如之，第三骑驰告。夜用鼓，如昼法（恐敌闻鼓声急驰告）。烟雾蓊塞，风雷震惊，旗之不见，鼓之不闻，亟驰告。斯谓八卦探骑者也。是以值贼而能备焉。苟天地有变，则引轻兵突之。大阵不可妄动（凡大兵出，常以轻骑数千人别分部队为游兵，其将择骁勇），观彼动静而后举焉，故我常用其整也。此皆随天之变也。或曰：与敌卒然相遇，或平原广泽，或山谷深峭，或坡嶝穹隆，或坳污沮洳，或草木蒙密，俱是危地，当其用之如何？许洞曰：回渠迂涧，可以冲车突驰也；深峡隘口，可以少击众也；长林丰草，可以为伏也；原野漫衍，可以骑兵相属也；草木隐障，可以步士接战；长郊往来，可进可退，可以长戟当敌；逾水跨远，高下相乘，不可得亲近，可以长弩当敌；崖壁相隐，狭径斗回，可以剑盾当敌；苇萧芦荻，枝叶朦胧，可以戈梃当敌。此皆随地之性也。或曰：寨栅之间，三军已憩，寇敌乘间冲突攻击，当此之时如之何？许洞曰：使勇者据其前，怯者匿其后。忽遽之时，怯者强驱而前进焉，必挫锋折锐，不若隐之也。曰：当此之时，何暇别勇怯之用乎？曰：不然。善用兵者，防乱於未乱，备急於未急。结营既定，预择强勇者卫外，怯弱者附之，所以虑晦夜之急也。此皆随人之性也。如是，顺天、地、人预备之道者也。故易之卦以豫者预也，取预备之象为难之用也。故曰：重门击柝，以待暴客，盖取诸豫。用兵者可不审於此乎？\n",
      "                    \n"
     ]
    }
   ],
   "source": [
    "s=soup.find_all(class_='chapter_content')\n",
    "print(s[0].get_text())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 67,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1--章节下载成功！\n",
      "2--章节下载成功！\n",
      "3--章节下载成功！\n",
      "4--章节下载成功！\n",
      "5--章节下载成功！\n",
      "6--章节下载成功！\n",
      "7--章节下载成功！\n",
      "8--章节下载成功！\n",
      "9--章节下载成功！\n",
      "10--章节下载成功！\n",
      "11--章节下载成功！\n",
      "12--章节下载成功！\n",
      "13--章节下载成功！\n",
      "14--章节下载成功！\n",
      "15--章节下载成功！\n",
      "16--章节下载成功！\n",
      "17--章节下载成功！\n",
      "18--章节下载成功！\n",
      "19--章节下载成功！\n",
      "20--章节下载成功！\n",
      "21--章节下载成功！\n",
      "22--章节下载成功！\n",
      "23--章节下载成功！\n",
      "24--章节下载成功！\n",
      "25--章节下载成功！\n",
      "26--章节下载成功！\n",
      "27--章节下载成功！\n",
      "28--章节下载成功！\n",
      "29--章节下载成功！\n",
      "30--章节下载成功！\n",
      "31--章节下载成功！\n",
      "32--章节下载成功！\n",
      "33--章节下载成功！\n",
      "34--章节下载成功！\n",
      "35--章节下载成功！\n",
      "36--章节下载成功！\n",
      "37--章节下载成功！\n",
      "38--章节下载成功！\n",
      "39--章节下载成功！\n",
      "40--章节下载成功！\n",
      "41--章节下载成功！\n",
      "42--章节下载成功！\n",
      "43--章节下载成功！\n",
      "44--章节下载成功！\n",
      "45--章节下载成功！\n",
      "46--章节下载成功！\n",
      "47--章节下载成功！\n",
      "48--章节下载成功！\n",
      "49--章节下载成功！\n",
      "50--章节下载成功！\n",
      "51--章节下载成功！\n",
      "52--章节下载成功！\n",
      "53--章节下载成功！\n",
      "54--章节下载成功！\n",
      "55--章节下载成功！\n",
      "56--章节下载成功！\n",
      "57--章节下载成功！\n",
      "58--章节下载成功！\n",
      "59--章节下载成功！\n",
      "60--章节下载成功！\n",
      "61--章节下载成功！\n",
      "62--章节下载成功！\n",
      "63--章节下载成功！\n",
      "64--章节下载成功！\n",
      "65--章节下载成功！\n",
      "66--章节下载成功！\n",
      "67--章节下载成功！\n",
      "68--章节下载成功！\n",
      "69--章节下载成功！\n",
      "70--章节下载成功！\n",
      "71--章节下载成功！\n",
      "72--章节下载成功！\n",
      "73--章节下载成功！\n",
      "74--章节下载成功！\n",
      "75--章节下载成功！\n",
      "76--章节下载成功！\n",
      "77--章节下载成功！\n",
      "78--章节下载成功！\n",
      "79--章节下载成功！\n",
      "80--章节下载成功！\n",
      "81--章节下载成功！\n",
      "82--章节下载成功！\n",
      "83--章节下载成功！\n",
      "84--章节下载成功！\n",
      "85--章节下载成功！\n",
      "86--章节下载成功！\n",
      "87--章节下载成功！\n",
      "88--章节下载成功！\n",
      "89--章节下载成功！\n",
      "90--章节下载成功！\n",
      "91--章节下载成功！\n",
      "92--章节下载成功！\n",
      "93--章节下载成功！\n",
      "94--章节下载成功！\n",
      "95--章节下载成功！\n",
      "96--章节下载成功！\n",
      "97--章节下载成功！\n",
      "98--章节下载成功！\n",
      "99--章节下载成功！\n",
      "100--章节下载成功！\n",
      "101--章节下载成功！\n",
      "102--章节下载成功！\n",
      "103--章节下载成功！\n",
      "104--章节下载成功！\n",
      "105--章节下载成功！\n",
      "106--章节下载成功！\n",
      "107--章节下载成功！\n",
      "108--章节下载成功！\n",
      "109--章节下载成功！\n",
      "110--章节下载成功！\n",
      "111--章节下载成功！\n",
      "112--章节下载成功！\n",
      "113--章节下载成功！\n",
      "114--章节下载成功！\n",
      "115--章节下载成功！\n",
      "116--章节下载成功！\n",
      "117--章节下载成功！\n",
      "118--章节下载成功！\n",
      "119--章节下载成功！\n"
     ]
    }
   ],
   "source": [
    "import requests\n",
    "import time\n",
    "\n",
    "for i in range(1,121):\n",
    "    url = 'https://www.shicimingju.com/book/hongloumeng/{}.html'.format(i)\n",
    "    #     print(url)\n",
    "    headers = {\n",
    "        'user-agent': 'Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.74 Mobile Safari/537.36'}\n",
    "\n",
    "    html = requests.get(url=url, headers=headers).content.decode('utf-8')\n",
    "\n",
    "    #     print(html)\n",
    "    from bs4 import BeautifulSoup\n",
    "\n",
    "    soup = BeautifulSoup(html, 'lxml')\n",
    "\n",
    "    #     print(soup.prettify())\n",
    "    s = soup.find_all(class_='chapter_content')\n",
    "    c = s[0].get_text()\n",
    "\n",
    "    with open('第' + str(i) + '章.text', 'a', encoding='utf-8') as f:\n",
    "        f.write(c)\n",
    "        print('%s--章节下载成功！' % i)\n",
    "    time.sleep(1)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 实战二"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.12"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
